diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index fa6442f3..e9beb009 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -63,11 +63,16 @@ jobs: run: make TAG=aarch64-latest image-tier1 - name: Test tier 1 Docker image run: make TAG=aarch64-latest test-tier1 + - name: Build tier 2 Docker image + run: make TAG=aarch64-latest image-tier2 + - name: Test tier 2 Docker image + run: make TAG=aarch64-latest test-tier2 - name: Push images to Docker if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master' run: | echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin docker push dmoj/runtimes-tier1:aarch64-latest + docker push dmoj/runtimes-tier2:aarch64-latest env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} @@ -76,6 +81,7 @@ jobs: run: | echo "$CR_PAT" | docker login ghcr.io -u "$CR_USER" --password-stdin docker push ghcr.io/dmoj/runtimes-tier1:aarch64-latest + docker push ghcr.io/dmoj/runtimes-tier2:aarch64-latest env: CR_USER: ${{ secrets.CR_USER }} CR_PAT: ${{ secrets.CR_PAT }} diff --git a/tier2/Dockerfile b/tier2/Dockerfile index ee09e4bb..a5f2ea6b 100644 --- a/tier2/Dockerfile +++ b/tier2/Dockerfile @@ -3,7 +3,7 @@ FROM dmoj/runtimes-tier1 RUN apt-get update && \ apt-get install -y --no-install-recommends \ jq apt-transport-https dirmngr gnupg ca-certificates \ - openjdk-17-jdk-headless clang ghc golang racket ruby scala nasm libc6-dev-i386 && \ + openjdk-17-jdk-headless clang ghc golang racket ruby scala nasm $([ "$(arch)" = x86_64 ] && echo libc6-dev-i386) && \ ( \ apt-get install -y --no-install-recommends make m4 patch unzip libgmp-dev && \ bash -c 'echo | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --no-backup' && \ @@ -11,10 +11,11 @@ RUN apt-get update && \ runuser -u judge -- opam install -y -j$(nproc) base core stdio zarith && \ runuser -u judge -- opam clean && rm -rf ~judge/.opam/repo \ ) && \ - mkdir /opt/pypy2 && curl -L "$(curl https://www.pypy.org/download.html | grep /pypy2 | head -n1 | cut -d'"' -f4)" | \ + if [ "$(arch)" = x86_64 ]; then PYPY_ARCH=linux64; else PYPY_ARCH="$(arch)"; fi && \ + mkdir /opt/pypy2 && curl -L "$(curl https://www.pypy.org/download.html | grep "/pypy2.*$PYPY_ARCH" | head -n1 | cut -d'"' -f4)" | \ tar xj -C /opt/pypy2 --strip-components=1 && /opt/pypy2/bin/pypy -mcompileall && \ rm -f /opt/pypy2/bin/python* && \ - mkdir /opt/pypy3 && curl -L "$(curl https://www.pypy.org/download.html | grep /pypy3 | head -n1 | cut -d'"' -f4)" | \ + mkdir /opt/pypy3 && curl -L "$(curl https://www.pypy.org/download.html | grep "/pypy3.*$PYPY_ARCH" | head -n1 | cut -d'"' -f4)" | \ tar xj -C /opt/pypy3 --strip-components=1 && /opt/pypy3/bin/pypy -mcompileall && \ rm -f /opt/pypy3/bin/python* && \ runuser judge -c 'curl https://sh.rustup.rs -sSf | sh -s -- -y' && \ @@ -31,13 +32,13 @@ RUN apt-get update && \ runuser -u judge /home/judge/.cargo/bin/cargo fetch \ ) && \ rm -rf rust && \ - curl -L -odmd.deb "$(curl -s https://dlang.org/download.html | perl -ne 'if(/"([^"~]*_amd64.deb)/){print $1;exit}')" && \ - apt install ./dmd.deb && rm dmd.deb && \ + if [ "$(arch)" = x86_64 ]; then curl -L -odmd.deb "$(curl -s https://dlang.org/download.html | perl -ne 'if(/"([^"~]*_amd64.deb)/){print $1;exit}')" && \ + apt install ./dmd.deb && rm dmd.deb; fi && \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ echo "deb https://download.mono-project.com/repo/debian stable-buster main" > \ /etc/apt/sources.list.d/mono-official-stable.list && \ curl https://dmoj.ca/dmoj-apt.key | apt-key add - && \ - echo 'deb [arch=amd64] https://apt.dmoj.ca/ stretch main non-free' > /etc/apt/sources.list.d/dmoj.list && \ + echo 'deb https://apt.dmoj.ca/ bullseye main' > /etc/apt/sources.list.d/dmoj.list && \ (echo 'Package: *'; echo 'Pin: origin download.mono-project.com'; echo 'Pin-Priority: 990') > /etc/apt/preferences.d/mono && \ apt-get update && \ (cd /tmp && \