From 1e9daf4af440ebc9d49b19a1569fc031ef074f68 Mon Sep 17 00:00:00 2001 From: cirolosapio Date: Wed, 24 Apr 2024 00:55:09 +0200 Subject: [PATCH] chore: Update devcontainer feature versions for Alpine-Docker-Outside-of-Docker --- .../devcontainer-feature.json | 4 ++-- src/alpine-docker-outside-of-docker/install.sh | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/alpine-docker-outside-of-docker/devcontainer-feature.json b/src/alpine-docker-outside-of-docker/devcontainer-feature.json index 8bc9a17..84b2dbf 100644 --- a/src/alpine-docker-outside-of-docker/devcontainer-feature.json +++ b/src/alpine-docker-outside-of-docker/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "alpine-docker-outside-of-docker", "id": "alpine-docker-outside-of-docker", - "version": "0.0.12", + "version": "0.0.13", "description": "Re-use the host docker socket, adding the Docker CLI to alpine container", "documentationURL": "https://github.com/cirolosapio/devcontainers-features/tree/main/src/alpine-docker-outside-of-docker", "installsAfter": [ @@ -17,7 +17,7 @@ "description": "Install Docker Compose?" } }, - "entrypoint": "/usr/local/share/docker-init.sh", + "postStartCommand": "/usr/local/share/docker-init.sh", "mounts": [ { "source": "/var/run/docker.sock", diff --git a/src/alpine-docker-outside-of-docker/install.sh b/src/alpine-docker-outside-of-docker/install.sh index 3a49160..ac572cc 100644 --- a/src/alpine-docker-outside-of-docker/install.sh +++ b/src/alpine-docker-outside-of-docker/install.sh @@ -4,6 +4,11 @@ set -e echo "Activating feature 'alpine-docker-outside-of-docker'" +# If init file already exists, exit +if [ -f "/usr/local/share/docker-init.sh" ]; then + exit 0 +fi + apk add --no-cache docker CURRENT_USER=$(getent passwd 1000 | cut -d: -f1) @@ -19,10 +24,6 @@ else tee /usr/local/share/docker-init.sh > /dev/null \ << EOF #!/bin/sh -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- set -e