-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |