From da860aeb04a28975cb167b2fcf24bef9b39943c5 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Wed, 28 Dec 2022 22:34:37 +0000 Subject: [PATCH] Fix (docker): Fix `docker` variants to cleanup `/var/run/docker.pid` when container is stopped and started `dockerd` fails to start if `/var/run/docker.pid` already exists. --- generate/templates/docker-entrypoint.sh.ps1 | 1 + variants/v4.6.1-docker-alpine-3.15/docker-entrypoint.sh | 1 + variants/v4.7.1-docker-alpine-3.15/docker-entrypoint.sh | 1 + variants/v4.8.3-docker-alpine-3.15/docker-entrypoint.sh | 1 + variants/v4.9.1-docker-alpine-3.15/docker-entrypoint.sh | 1 + 5 files changed, 5 insertions(+) diff --git a/generate/templates/docker-entrypoint.sh.ps1 b/generate/templates/docker-entrypoint.sh.ps1 index 869e9a55..e177fdc7 100644 --- a/generate/templates/docker-entrypoint.sh.ps1 +++ b/generate/templates/docker-entrypoint.sh.ps1 @@ -10,6 +10,7 @@ if ($VARIANT['_metadata']['base_tag']) { if ($c -eq 'docker') { @' echo "Starting dockerd" +sudo rm -fv /var/run/docker.pid sudo dockerd & '@ diff --git a/variants/v4.6.1-docker-alpine-3.15/docker-entrypoint.sh b/variants/v4.6.1-docker-alpine-3.15/docker-entrypoint.sh index 654b0664..675abfcd 100644 --- a/variants/v4.6.1-docker-alpine-3.15/docker-entrypoint.sh +++ b/variants/v4.6.1-docker-alpine-3.15/docker-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/sh set -eu echo "Starting dockerd" +sudo rm -fv /var/run/docker.pid sudo dockerd & echo "Starting code-server" exec code-server --bind-addr 0.0.0.0:8080 --disable-telemetry --disable-update-check \ No newline at end of file diff --git a/variants/v4.7.1-docker-alpine-3.15/docker-entrypoint.sh b/variants/v4.7.1-docker-alpine-3.15/docker-entrypoint.sh index 654b0664..675abfcd 100644 --- a/variants/v4.7.1-docker-alpine-3.15/docker-entrypoint.sh +++ b/variants/v4.7.1-docker-alpine-3.15/docker-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/sh set -eu echo "Starting dockerd" +sudo rm -fv /var/run/docker.pid sudo dockerd & echo "Starting code-server" exec code-server --bind-addr 0.0.0.0:8080 --disable-telemetry --disable-update-check \ No newline at end of file diff --git a/variants/v4.8.3-docker-alpine-3.15/docker-entrypoint.sh b/variants/v4.8.3-docker-alpine-3.15/docker-entrypoint.sh index 654b0664..675abfcd 100644 --- a/variants/v4.8.3-docker-alpine-3.15/docker-entrypoint.sh +++ b/variants/v4.8.3-docker-alpine-3.15/docker-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/sh set -eu echo "Starting dockerd" +sudo rm -fv /var/run/docker.pid sudo dockerd & echo "Starting code-server" exec code-server --bind-addr 0.0.0.0:8080 --disable-telemetry --disable-update-check \ No newline at end of file diff --git a/variants/v4.9.1-docker-alpine-3.15/docker-entrypoint.sh b/variants/v4.9.1-docker-alpine-3.15/docker-entrypoint.sh index 654b0664..675abfcd 100644 --- a/variants/v4.9.1-docker-alpine-3.15/docker-entrypoint.sh +++ b/variants/v4.9.1-docker-alpine-3.15/docker-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/sh set -eu echo "Starting dockerd" +sudo rm -fv /var/run/docker.pid sudo dockerd & echo "Starting code-server" exec code-server --bind-addr 0.0.0.0:8080 --disable-telemetry --disable-update-check \ No newline at end of file