File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,17 @@ jobs:
12
12
steps :
13
13
- name : run docker resource config
14
14
run : |
15
- sudo touch $PWD/slice.conf
16
- cat <<EOF > $PWD/slice.conf
15
+ sudo touch /etc/systemd/system/docker_limit.slice
16
+ cat <<EOF > /etc/systemd/system/docker_limit.slice
17
17
[Unit]
18
18
Description=Slice that limits docker resources
19
19
Before=slices.target
20
20
[Slice]
21
21
CPUAccounting=true
22
22
CPUQuota=50%
23
23
EOF
24
- sudo systemctl start $PWD/slice.conf
25
- new_content='{ "exec-opts": ["native.cgroupdriver=cgroupfs"], "cgroup-parent": "/slice.conf " }'
24
+ sudo systemctl start /etc/systemd/system/docker_limit.slice
25
+ new_content='{ "exec-opts": ["native.cgroupdriver=cgroupfs"], "cgroup-parent": "/docker_limit.slice " }'
26
26
sudo sed -i 's|{ "exec-opts": \["native.cgroupdriver=cgroupfs"\], "cgroup-parent": "/actions_job" }|'"$new_content"'|' /etc/docker/daemon.json
27
27
cat /etc/docker/daemon.json
28
28
sudo systemctl restart docker
You can’t perform that action at this time.
0 commit comments