diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index b0f67a78..b6b04ff2 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -162,79 +162,84 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
+        img: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"]
         sslpkg: [libmbedtls-dev]
         ssllib: [mbedtls]
         libname: [mbed TLS]
 
         include:
-          - os: ubuntu-18.04
+          - img: "ubuntu:18.04"
             sslpkg: "libssl1.0-dev"
             ssllib: openssl
             libname: OpenSSL 1.0.2
-          - os: ubuntu-18.04
+          - img: "ubuntu:18.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
-          - os: ubuntu-22.04
+          - img: "ubuntu:22.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 3.0.2
             ssllib: openssl
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--enable-iproute2"
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--enable-async-push"
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--disable-management"
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--enable-small"
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--disable-lzo --disable-lz4"
-          - os: ubuntu-20.04
+          - img: "ubuntu:20.04"
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--enable-dco"
             nlpkg: "libnl-genl-3-dev"
 
-    name: "gcc - ${{matrix.os}} - ${{matrix.libname}} ${{matrix.extraconf}}"
+    name: "gcc - ${{matrix.img}} - ${{matrix.libname}} ${{matrix.extraconf}}"
     env:
       SSLPKG: "${{matrix.sslpkg}}"
       NLPKG: "${{matrix.nlpkg}}"
 
-    runs-on: ${{matrix.os}}
+    runs-on: ubuntu-latest
     steps:
-      - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG} ${NLPKG}
       - name: Checkout OpenVPN
         uses: actions/checkout@v3
+      - name: Setup Container
+        run: docker run --name ovpn --detach --rm --cap-add NET_ADMIN --network host -v "$PWD:/wd" --workdir=/wd "${{matrix.img}}" sleep 3600
+      - name: Install dependencies
+        run: docker exec ovpn sh -c "apt update && apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html libcmocka-dev python3-docutils build-essential pkgconf libtool automake autoconf iproute2 git ${SSLPKG} ${NLPKG}"
       - name: autoconf
-        run: autoreconf -fvi
+        run: docker exec ovpn autoreconf -fvi
       - name: configure
-        run: ./configure --with-crypto-library=${{matrix.ssllib}} ${{matrix.extraconf}} --enable-werror
+        run: docker exec ovpn ./configure --with-crypto-library=${{matrix.ssllib}} ${{matrix.extraconf}} --enable-werror
       - name: make all
-        run: make -j3
+        run: docker exec ovpn make -j3
       - name: make check
-        run: make check
+        run: docker exec ovpn make check
+      - name: Docker Cleanup
+        if: always()
+        run: docker kill ovpn || true
 
   ubuntu-clang-asan:
     strategy:
