Skip to content

Commit e381e94

Browse files
authored
Merge pull request #491 from AkihiroSuda/dev
CI: test Docker v28 in addition to v27
2 parents b11ee46 + 8f2b39f commit e381e94

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/main.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ jobs:
186186
test-integration-docker:
187187
name: "Integration test (Docker)"
188188
runs-on: ubuntu-24.04
189+
strategy:
190+
fail-fast: false
191+
matrix:
192+
# The design of the proxy was changed in Docker v28.
193+
# rootlesskit-docker-proxy is no longer used since Docker v28.
194+
docker_version: [27.5.1, 28.0.1]
189195
steps:
190196
- name: "Set up AppArmor"
191197
run: |
@@ -201,7 +207,9 @@ jobs:
201207
- name: "Check out"
202208
uses: actions/checkout@v4
203209
- name: "Build integration test image"
204-
run: DOCKER_BUILDKIT=1 docker build -t rootlesskit:test-integration-docker --target test-integration-docker .
210+
run: DOCKER_BUILDKIT=1 docker build -t rootlesskit:test-integration-docker --target test-integration-docker --build-arg DOCKER_VERSION .
211+
env:
212+
DOCKER_VERSION: ${{ matrix.docker_version }}
205213
- name: "Create a custom network to avoid IP confusion"
206214
run: docker network create custom
207215
- name: "Docker Integration test: net=slirp4netns, port-driver=builtin"

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG SHADOW_VERSION=4.16.0
44
ARG SLIRP4NETNS_VERSION=v1.3.1
55
ARG VPNKIT_VERSION=0.5.0
66
ARG PASST_VERSION=2024_12_11.09478d5
7-
ARG DOCKER_VERSION=27.5.0
7+
ARG DOCKER_VERSION=28.0.1
88
ARG DOCKER_CHANNEL=stable
99

1010
FROM golang:${GO_VERSION}-alpine AS build
@@ -92,12 +92,18 @@ ENV LD_LIBRARY_PATH=/home/user/lib
9292
WORKDIR /home/user/hack
9393

9494
FROM test-integration AS test-integration-docker
95-
COPY --from=artifact /rootlesskit-docker-proxy /home/user/bin/
9695
ARG DOCKER_VERSION
9796
ARG DOCKER_CHANNEL
9897
RUN curl -fsSL https://download.docker.com/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz | tar xz --strip-components=1 -C /home/user/bin/
9998
RUN curl -fsSL -o /home/user/bin/dockerd-rootless.sh https://raw.githubusercontent.com/moby/moby/v${DOCKER_VERSION}/contrib/dockerd-rootless.sh && \
10099
chmod +x /home/user/bin/dockerd-rootless.sh
100+
# rootlesskit-docker-proxy is no longer needed since Docker v28
101+
RUN --mount=source=/rootlesskit-docker-proxy,target=/tmp/rootlesskit-docker-proxy,from=artifact <<EOT
102+
set -ex
103+
if [ "$(echo ${DOCKER_VERSION} | cut -d . -f 1)" -lt "28" ]; then
104+
cp -a /tmp/rootlesskit-docker-proxy /home/user/bin
105+
fi
106+
EOT
101107
ENV DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns
102108
ENV DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=builtin
103109
ENV DOCKER_HOST=unix:///run/user/2000/docker.sock

0 commit comments

Comments
 (0)