Skip to content

Commit

Permalink
Fix: Docker containers could not run in runtime
Browse files Browse the repository at this point in the history
Solution: Mount cgroups, configure iptables and install dependencies
  • Loading branch information
hoh committed Feb 3, 2023
1 parent f6038d7 commit c8a2e43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions runtimes/aleph-alpine-3.13-python/init0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ mount -t tmpfs run /run -o mode=0755,nosuid,nodev
mount -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
mount -t tmpfs shm /dev/shm -omode=1777,nosuid,nodev

# Required by Docker
cgroupfs-mount
update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

# Enable the following to force the storage driver used by Docker.
# See https://docs.docker.com/storage/storagedriver/select-storage-driver/
#echo '{\n"storage-driver": "overlay2"\n}\n' > /etc/docker/daemon.json

# List block devices
lsblk

Expand Down
8 changes: 7 additions & 1 deletion runtimes/aleph-debian-11-python/create_disk_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ apt-get install -y --no-install-recommends --no-install-suggests \
python3-pip python3-cytoolz python3-pydantic \
iproute2 unzip \
nodejs npm \
build-essential python3-dev
build-essential python3-dev \
\
docker.io \
cgroupfs-mount \
nftables \
\
iputils-ping curl
pip3 install 'fastapi~=0.71.0'
Expand Down

0 comments on commit c8a2e43

Please sign in to comment.