Skip to content

Commit de8b5fe

Browse files
JonZeollaclaude
andcommitted
feat: add WSL 2 + Docker for Linux container builds on Windows CI
Install Ubuntu 24.04 in WSL, set up Docker Engine inside it, and use it to build and verify the Linux Docker image on the Windows runner. No third-party actions required — uses native wsl commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d7e9a87 commit de8b5fe

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,35 @@ jobs:
229229
run: |
230230
cd "$RUNNER_TEMP/replace-me"
231231
task -v unit-test
232+
- name: Setup WSL with Docker
233+
shell: bash
234+
run: |
235+
wsl --install -d Ubuntu-24.04 --no-launch
236+
wsl -d Ubuntu-24.04 -u root -- bash -ec "
237+
apt-get update -qq
238+
apt-get install -y -qq curl ca-certificates >/dev/null
239+
curl -fsSL https://get.docker.com | sh -s -- --quiet
240+
service docker start
241+
docker buildx create --use
242+
"
243+
- name: Build Docker image
244+
shell: bash
245+
run: |
246+
wsl_project="$(wsl -d Ubuntu-24.04 -- wslpath "$RUNNER_TEMP")/replace-me"
247+
wsl -d Ubuntu-24.04 -u root --cd "$wsl_project" -- docker buildx build \
248+
--platform linux/amd64 \
249+
--pull --load \
250+
--build-arg NAME=replace_me \
251+
--build-arg "DESCRIPTION=A brief description of the project" \
252+
--build-arg "TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
253+
--build-arg COMMIT_HASH=smoke-test \
254+
-t zenable-io/replace-me:latest .
255+
- name: Verify Docker image
256+
shell: bash
257+
run: |
258+
wsl -d Ubuntu-24.04 -u root -- docker run --rm --entrypoint python3 \
259+
zenable-io/replace-me:latest \
260+
-c "from replace_me import __version__; print(__version__)"
232261
- name: Verify zenable CLI
233262
shell: bash
234263
run: |

0 commit comments

Comments
 (0)