From 4fd0d91fe800af1d507be7b90f5aae7db02e0e66 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Thu, 26 Mar 2026 20:50:55 -0300 Subject: [PATCH] feat: add docker-on-docker support --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ Dockerfile | 13 +++++++++---- README.md | 1 + 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..94277f1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "build": { + "dockerfile": "../Dockerfile" + }, + "overrideCommand": false, + "runArgs": ["--use-api-socket", "--network=host"], + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker", + "docker.docker", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github" + ] + } + } +} diff --git a/Dockerfile b/Dockerfile index c3aa5b8..806af6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # renovate: datasource=docker depName=ghcr.io/containerbase/base ARG CONTAINERBASE_VERSION=14.6.8 -FROM ghcr.io/containerbase/base:${CONTAINERBASE_VERSION} as containerbase +FROM ghcr.io/containerbase/base:${CONTAINERBASE_VERSION} AS containerbase FROM ghcr.io/containerbase/ubuntu:24.04@sha256:186072bba1b2f436cbb91ef2567abca677337cfc786c86e107d25b7072feef0c @@ -19,9 +19,6 @@ ARG PRIMARY_GROUP_ID=1000 ENV BASH_ENV=/usr/local/etc/env ENV=/usr/local/etc/env SHELL ["/bin/bash" , "-c"] -# This entry point ensures that dumb-init is run -ENTRYPOINT [ "docker-entrypoint.sh" ] - # Set up containerbase COPY --from=containerbase /usr/local/sbin/ /usr/local/sbin/ COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/ @@ -70,5 +67,13 @@ RUN install-tool pnpm 10.32.1 # renovate: datasource=github-releases packageName=containerbase/python-prebuild RUN install-tool python 3.14.3 +# renovate: datasource=github-releases packageName=felipecrs/fixdockergid +ARG FIXDOCKERGID_VERSION=0.8.1 +ARG USERNAME=$USER_NAME +RUN curl -fsSL "https://github.com/felipecrs/fixdockergid/raw/v${FIXDOCKERGID_VERSION}/install.sh" | sh - + +# This entry point ensures that dumb-init and fixdockergid is run +ENTRYPOINT [ "docker-entrypoint.sh", "fixdockergid" ] +CMD [ "sleep", "infinity" ] USER $USER_NAME diff --git a/README.md b/README.md index eafea6a..bd627d6 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Commits to `main` branch are automatically build and published. This image allows `sudo` without password. It's setting all directiories as safe for git. +Also supports docker-on-docker when ran with `--use-api-socket` flag. Additional installed packages: