Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,13 @@ jobs:
(cd common && npm install && npm run build)
(cd github-action/ && npm install && npm run build && npm run package)

- name: UID INFO
run: echo 'UID INFO'; id; ls -l /var/run/docker.sock

- name: Set DOCKER_GID
run: |
echo "DOCKER_GID=$(getent group docker | cut -d: -f3)" >> $GITHUB_ENV

- name: Run test
uses: ./
with:
Expand All @@ -775,6 +782,8 @@ jobs:
eventFilterForPush: |
push
pull_request
env:
DOCKER_GID: ${{ env.DOCKER_GID }}

test-gh-docker-from-docker-root:
name: Run GitHub docker-from-docker-root test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ COPY scripts/docker-client.sh /tmp/
RUN /tmp/docker-client.sh

#Add user to docker group
RUN sudo groupadd docker && sudo usermod -aG docker $USERNAME && newgrp docker
ARG DOCKER_GID=
RUN if [ -n "$DOCKER_GID" ]; then \
sudo groupadd -g $DOCKER_GID docker; \
else \
sudo groupadd docker; \
fi \
&& sudo usermod -aG docker $USERNAME

# __DEVCONTAINER_SNIPPET_INSERT__ (control where snippets get inserted using the devcontainer CLI)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"name": "dc-test",
"dockerFile": "Dockerfile",
"build": {
"args": {
"DOCKER_GID": "${localEnv:DOCKER_GID}"
},
"cacheFrom": "ghcr.io/devcontainers/ci/tests/docker-from-docker-non-root:latest"
},

Expand Down Expand Up @@ -55,6 +58,7 @@

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./scripts/go-tools.sh",
"postStartCommand": "echo 'UID INFO'; id; ls -l /var/run/docker.sock",

"remoteUser": "vscode",

Expand Down