Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary permissions #1112

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions core/entry.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#!/bin/bash

misc_major=10
loop_major=7
loopctrl_minor=$(grep loop-control /proc/misc | cut -d ' ' -f1)
if [ -n "${loopctrl_minor}" ]; then
if ! mknod -m 660 /dev/loop-control c "${misc_major}" "${loopctrl_minor}"; then
echo "Unable to create loop-control device node"
exit 1
fi

for i in $(seq 0 128); do
mknod -m 660 "/dev/loop${i}" b "${loop_major}" "${i}"
done
fi


rm -rf /var/run/docker 2>/dev/null || true
rm -f /var/run/docker.sock 2>/dev/null || true
rm -f /var/run/docker.pid 2>/dev/null || true
Expand Down
10 changes: 7 additions & 3 deletions docker-compose.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ services:
- core

core:
privileged: true # preload requires docker-in-docker
device_cgroup_rules:
# https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
# loopback devices
- "b 7:* rmw"
cap_add:
- SYS_ADMIN
- NET_ADMIN
build: core
volumes:
- core-storage:/data
Expand All @@ -32,8 +38,6 @@ services:
- /var/run # use tmpfs docker-in-docker pid files
- /var/lib/docker # use tmpfs for docker-in-docker data root
restart: 'no'
devices:
- /dev:/dev # required for creating losetup devices during preload

volumes:
core-storage:
Expand Down
Loading