Skip to content

Commit

Permalink
Experiment with running Docker-in-Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Aug 1, 2023
1 parent 6ab0040 commit 443de42
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ jobs:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Tianon's Moby
run: |
# https://github.com/tianon/debian-moby
# https://hub.docker.com/r/infosiftr/moby
dir="$(mktemp -d)"
dir="$(readlink -ve "$dir")"
mkdir -p "$dir/run" "$dir/var-lib-docker"
host="unix://$dir/run/docker.sock"
docker run -d --name moby --privileged --mount "type=bind,src=$PWD,dst=$PWD" --workdir "$PWD" --mount "type=bind,src=$dir,dst=$dir" infosiftr/moby dockerd --data-root "$dir/var-lib-docker" --host "$host"
printf 'DOCKER_HOST=%s\n' "$host" >> "$GITHUB_ENV"
export DOCKER_HOST="$host"
timeout 10s bash -Eeuo pipefail -xc 'while ! docker version; do sleep 1; done'
docker logs moby
- uses: actions/checkout@v3
# TODO something clever with https://github.com/marketplace/actions/changed-files
- name: Prepare Environment
Expand Down

0 comments on commit 443de42

Please sign in to comment.