diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index e732a29320..fb2f3f628a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -182,3 +182,27 @@ jobs: run: chmod +x ./youki - name: Run tests run: just test-rootless-podman + + docker-in-docker: + runs-on: ${{ matrix.os }} + needs: [youki-build] + timeout-minutes: 5 + strategy: + matrix: + # ubuntu 20.04 has cgroups-v1 + # ubuntu 22.04 has cgroups-v2 + os: [ "ubuntu-22.04", "ubuntu-20.04" ] + steps: + - uses: actions/checkout@v3 + - name: Install just + uses: taiki-e/install-action@just + - name: Download youki binary + uses: actions/download-artifact@v3 + with: + name: youki-x86_64-musl + - name: Add the permission to run + run: chmod +x ./youki + - name: Run tests + run: just test-dind + + diff --git a/justfile b/justfile index 59ebf1b90d..853a0cf1bc 100644 --- a/justfile +++ b/justfile @@ -65,6 +65,9 @@ validate-contest-runc: contest test-rootless-podman: {{ cwd }}/tests/rootless-tests/run.sh {{ cwd }}/youki +# test docker-in-docker works with youki +test-dind: + {{ cwd }}/tests/dind/run.sh # run containerd integration tests containerd-test: youki-dev diff --git a/tests/dind/daemon.json b/tests/dind/daemon.json new file mode 100644 index 0000000000..a1cdbedd14 --- /dev/null +++ b/tests/dind/daemon.json @@ -0,0 +1,7 @@ +{ + "runtimes": { + "youki": { + "path": "/usr/bin/youki" + } + } +} \ No newline at end of file diff --git a/tests/dind/run.sh b/tests/dind/run.sh new file mode 100755 index 0000000000..b0e5a5555a --- /dev/null +++ b/tests/dind/run.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +ROOT=$(git rev-parse --show-toplevel) + +docker run --privileged -dq \ + --name youki-test-dind \ + -v $ROOT/youki:/usr/bin/youki \ + -v $ROOT/tests/dind/daemon.json:/etc/docker/daemon.json \ + docker:dind > /dev/null + +trap "docker rm -f youki-test-dind > /dev/null" EXIT + +# give dockerd time to start +sleep 2 + +docker exec -i youki-test-dind \ + docker run -q --runtime=youki hello-world