Skip to content

Commit

Permalink
fix: make the docker-dbox work
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed Jun 19, 2024
1 parent dbef2cb commit dde3e42
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions apps/docker/Containerfile.docker
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
FROM ghcr.io/ublue-os/ubuntu-toolbox

RUN apt-get update && \
apt-get install -y \
ca-certificates \
curl \
systemd && \
mkdir -p /etc/apt/keyrings/ && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o \
/etc/apt/keyrings/docker.asc && \
echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
> /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
apt-get clean && \
mkdir -p /var/lib/docker && \
groupmod -g 252 docker && \
systemctl enable docker.socket

RUN <<EOF
apt-get update
apt-get install -y ca-certificates curl socat systemd
mkdir -p /etc/apt/keyrings/
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") \
stable" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
apt-get clean
mkdir -p /var/lib/docker
rm -rf /var/lib/docker/**
rm -f /usr/local/bin/docker
cat > /usr/lib/systemd/system/docker-setup-var.service <<- EEOF
[Unit]
Description=Setup Docker Socket in /var/run/
After=docker.socket
[Service]
ExecStart=sh -c "while true; do sleep 1; /usr/bin/socat UNIX-LISTEN:/run/host/var/run/docker.sock,reuseaddr,fork,group=docker,umask=007 UNIX-CONNECT:/var/run/docker.sock; done"
[Install]
WantedBy=sockets.target
EEOF
groupmod -g 252 docker
systemctl enable docker-setup-var.service
EOF
CMD ["/sbin/init"]

0 comments on commit dde3e42

Please sign in to comment.