Skip to content

Commit 4fd0d91

Browse files
committed
feat: add docker-on-docker support
1 parent 7c78f35 commit 4fd0d91

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"build": {
3+
"dockerfile": "../Dockerfile"
4+
},
5+
"overrideCommand": false,
6+
"runArgs": ["--use-api-socket", "--network=host"],
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-azuretools.vscode-docker",
11+
"docker.docker",
12+
"github.vscode-github-actions",
13+
"GitHub.vscode-pull-request-github"
14+
]
15+
}
16+
}
17+
}

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# renovate: datasource=docker depName=ghcr.io/containerbase/base
22
ARG CONTAINERBASE_VERSION=14.6.8
33

4-
FROM ghcr.io/containerbase/base:${CONTAINERBASE_VERSION} as containerbase
4+
FROM ghcr.io/containerbase/base:${CONTAINERBASE_VERSION} AS containerbase
55

66
FROM ghcr.io/containerbase/ubuntu:24.04@sha256:186072bba1b2f436cbb91ef2567abca677337cfc786c86e107d25b7072feef0c
77

@@ -19,9 +19,6 @@ ARG PRIMARY_GROUP_ID=1000
1919
ENV BASH_ENV=/usr/local/etc/env ENV=/usr/local/etc/env
2020
SHELL ["/bin/bash" , "-c"]
2121

22-
# This entry point ensures that dumb-init is run
23-
ENTRYPOINT [ "docker-entrypoint.sh" ]
24-
2522
# Set up containerbase
2623
COPY --from=containerbase /usr/local/sbin/ /usr/local/sbin/
2724
COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/
@@ -70,5 +67,13 @@ RUN install-tool pnpm 10.32.1
7067
# renovate: datasource=github-releases packageName=containerbase/python-prebuild
7168
RUN install-tool python 3.14.3
7269

70+
# renovate: datasource=github-releases packageName=felipecrs/fixdockergid
71+
ARG FIXDOCKERGID_VERSION=0.8.1
72+
ARG USERNAME=$USER_NAME
73+
RUN curl -fsSL "https://github.com/felipecrs/fixdockergid/raw/v${FIXDOCKERGID_VERSION}/install.sh" | sh -
74+
75+
# This entry point ensures that dumb-init and fixdockergid is run
76+
ENTRYPOINT [ "docker-entrypoint.sh", "fixdockergid" ]
77+
CMD [ "sleep", "infinity" ]
7378

7479
USER $USER_NAME

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Commits to `main` branch are automatically build and published.
1111

1212
This image allows `sudo` without password.
1313
It's setting all directiories as safe for git.
14+
Also supports docker-on-docker when ran with `--use-api-socket` flag.
1415

1516
Additional installed packages:
1617

0 commit comments

Comments
 (0)