From 4ee5d5383d8f28c69faed76275fa4ed21130b658 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Fri, 30 Sep 2022 08:47:45 -0500 Subject: [PATCH 01/11] Refactor Dockerfiles into base images. --- .github/workflows/ci.yml | 89 ++++++++++++++++++- docker/Dockerfile.aarch64-linux-android | 11 +-- docker/Dockerfile.aarch64-unknown-linux-gnu | 11 +-- docker/Dockerfile.aarch64-unknown-linux-musl | 11 +-- docker/Dockerfile.arm-linux-androideabi | 11 +-- docker/Dockerfile.arm-unknown-linux-gnueabi | 11 +-- docker/Dockerfile.arm-unknown-linux-gnueabihf | 11 +-- docker/Dockerfile.arm-unknown-linux-musleabi | 11 +-- .../Dockerfile.arm-unknown-linux-musleabihf | 11 +-- .../Dockerfile.armv5te-unknown-linux-gnueabi | 11 +-- .../Dockerfile.armv5te-unknown-linux-musleabi | 11 +-- docker/Dockerfile.armv7-linux-androideabi | 11 +-- docker/Dockerfile.armv7-unknown-linux-gnueabi | 11 +-- .../Dockerfile.armv7-unknown-linux-gnueabihf | 11 +-- .../Dockerfile.armv7-unknown-linux-musleabi | 11 +-- .../Dockerfile.armv7-unknown-linux-musleabihf | 11 +-- docker/Dockerfile.centos | 10 +++ docker/Dockerfile.emscripten | 12 +++ docker/Dockerfile.i586-unknown-linux-gnu | 11 +-- docker/Dockerfile.i586-unknown-linux-musl | 11 +-- docker/Dockerfile.i686-linux-android | 11 +-- docker/Dockerfile.i686-pc-windows-gnu | 11 +-- docker/Dockerfile.i686-unknown-freebsd | 11 +-- docker/Dockerfile.i686-unknown-linux-gnu | 11 +-- docker/Dockerfile.i686-unknown-linux-musl | 11 +-- docker/Dockerfile.mips-unknown-linux-gnu | 11 +-- docker/Dockerfile.mips-unknown-linux-musl | 11 +-- .../Dockerfile.mips64-unknown-linux-gnuabi64 | 11 +-- .../Dockerfile.mips64-unknown-linux-muslabi64 | 12 +-- ...Dockerfile.mips64el-unknown-linux-gnuabi64 | 11 +-- ...ockerfile.mips64el-unknown-linux-muslabi64 | 12 +-- docker/Dockerfile.mipsel-unknown-linux-gnu | 11 +-- docker/Dockerfile.mipsel-unknown-linux-musl | 11 +-- docker/Dockerfile.powerpc-unknown-linux-gnu | 11 +-- docker/Dockerfile.powerpc64-unknown-linux-gnu | 11 +-- .../Dockerfile.powerpc64le-unknown-linux-gnu | 11 +-- docker/Dockerfile.riscv64gc-unknown-linux-gnu | 11 +-- docker/Dockerfile.s390x-unknown-linux-gnu | 11 +-- docker/Dockerfile.sparc64-unknown-linux-gnu | 11 +-- docker/Dockerfile.sparcv9-sun-solaris | 11 +-- docker/Dockerfile.thumbv6m-none-eabi | 11 +-- docker/Dockerfile.thumbv7em-none-eabi | 11 +-- docker/Dockerfile.thumbv7em-none-eabihf | 11 +-- docker/Dockerfile.thumbv7m-none-eabi | 11 +-- .../Dockerfile.thumbv7neon-linux-androideabi | 11 +-- ...erfile.thumbv7neon-unknown-linux-gnueabihf | 11 +-- docker/Dockerfile.ubuntu | 11 +++ docker/Dockerfile.wasm32-unknown-emscripten | 13 +-- docker/Dockerfile.x86_64-linux-android | 11 +-- docker/Dockerfile.x86_64-pc-windows-gnu | 11 +-- docker/Dockerfile.x86_64-sun-solaris | 11 +-- docker/Dockerfile.x86_64-unknown-dragonfly | 11 +-- docker/Dockerfile.x86_64-unknown-freebsd | 11 +-- docker/Dockerfile.x86_64-unknown-illumos | 12 +-- docker/Dockerfile.x86_64-unknown-linux-gnu | 11 +-- ...Dockerfile.x86_64-unknown-linux-gnu.centos | 11 +-- docker/Dockerfile.x86_64-unknown-linux-musl | 11 +-- docker/Dockerfile.x86_64-unknown-netbsd | 11 +-- xtask/src/util.rs | 49 ++++------ 59 files changed, 196 insertions(+), 574 deletions(-) create mode 100644 docker/Dockerfile.centos create mode 100644 docker/Dockerfile.emscripten create mode 100644 docker/Dockerfile.ubuntu diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 974a82102..97df737ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,10 +98,97 @@ jobs: COMMIT_MESSAGE: ${{ github.event.head_commit.message }} COMMIT_AUTHOR: ${{ github.event.head_commit.author.username }} + build-base: + name: base (${{ matrix.image }}) + runs-on: ubuntu-latest + needs: [shellcheck, test, check] + if: github.event_name == 'push' + strategy: + fail-fast: false + matrix: + image: + - ubuntu + - centos + - emscripten + outputs: + images: ${{ steps.build-docker-image.outputs.images && fromJSON(steps.build-docker-image.outputs.images) }} + coverage-artifact: ${{ steps.cov.outputs.artifact-name }} + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/setup-rust + + - name: Set up Docker Buildx + if: runner.os == 'Linux' + uses: docker/setup-buildx-action@v1 + + - name: Build xtask + run: cargo build -p xtask + + - name: Prepare Meta + id: prepare-meta + timeout-minutes: 60 + run: cargo xtask ci-job prepare-meta "${IMAGE}" + env: + IMAGE: ${{ matrix.image }} + shell: bash + + - name: LLVM instrument coverage + uses: ./.github/actions/cargo-llvm-cov + with: + name: cross-${{matrix.image}} + + - name: Install cross + if: matrix.deploy + run: cargo install --path . --force --debug + + - name: Docker Meta + id: docker-meta + uses: docker/metadata-action@v4 + with: + images: | + name=${{ steps.prepare-meta.outputs.image }} + labels: | + ${{ fromJSON(steps.prepare-meta.outputs.labels) }} + - name: Build Docker image + id: build-docker-image + timeout-minutes: 60 + run: cargo xtask build-docker-image -v "${IMAGE}" + env: + IMAGE: ${{ matrix.image }} + LABELS: ${{ steps.docker-meta.outputs.labels }} + LATEST: ${{ needs.check.outputs.is-latest || 'false' }} + shell: bash + + - uses: ./.github/actions/cargo-install-upload-artifacts + if: matrix.deploy + with: + target: ${{ matrix.image }} + image: ${{ steps.build-docker-image.outputs.image }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push image to GitHub Container Registry + if: > + ( + github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || + startsWith(github.ref, 'refs/tags/v') + ) + run: cargo xtask build-docker-image -v --push "${IMAGE}" + env: + IMAGE: ${{ matrix.target }} + LABELS: ${{ steps.docker-meta.outputs.labels }} + LATEST: ${{ needs.check.outputs.is-latest || 'false' }} + shell: bash + build: name: target (${{ matrix.pretty }},${{ matrix.os }}) runs-on: ${{ matrix.os }} - needs: [shellcheck, test, generate-matrix, check] + needs: [shellcheck, test, generate-matrix, check, build-base] if: github.event_name == 'push' strategy: fail-fast: false diff --git a/docker/Dockerfile.aarch64-linux-android b/docker/Dockerfile.aarch64-linux-android index ea85d5d51..70f0a36cc 100644 --- a/docker/Dockerfile.aarch64-linux-android +++ b/docker/Dockerfile.aarch64-linux-android @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh arm64 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index 2480cd6da..3707344f4 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-aarch64-linux-gnu \ libc6-dev-arm64-cross diff --git a/docker/Dockerfile.aarch64-unknown-linux-musl b/docker/Dockerfile.aarch64-unknown-linux-musl index 7dc97b794..685a586f7 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-musl +++ b/docker/Dockerfile.aarch64-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh aarch64 diff --git a/docker/Dockerfile.arm-linux-androideabi b/docker/Dockerfile.arm-linux-androideabi index 3faae941d..5e1a2046b 100644 --- a/docker/Dockerfile.arm-linux-androideabi +++ b/docker/Dockerfile.arm-linux-androideabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh arm 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index db370a6f1..8d2d328f2 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ libc6-dev-armel-cross diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabihf b/docker/Dockerfile.arm-unknown-linux-gnueabihf index e5217c305..a70437a2d 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabihf +++ b/docker/Dockerfile.arm-unknown-linux-gnueabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - ARG VERBOSE COPY crosstool-ng.sh / COPY crosstool-config/arm-unknown-linux-gnueabihf.config / diff --git a/docker/Dockerfile.arm-unknown-linux-musleabi b/docker/Dockerfile.arm-unknown-linux-musleabi index 1fbbe8ec3..13856a896 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabi +++ b/docker/Dockerfile.arm-unknown-linux-musleabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh arm diff --git a/docker/Dockerfile.arm-unknown-linux-musleabihf b/docker/Dockerfile.arm-unknown-linux-musleabihf index e7ae93732..30043ffb0 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabihf +++ b/docker/Dockerfile.arm-unknown-linux-musleabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh arm diff --git a/docker/Dockerfile.armv5te-unknown-linux-gnueabi b/docker/Dockerfile.armv5te-unknown-linux-gnueabi index 91ab30df5..02f47e7f8 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv5te-unknown-linux-gnueabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ crossbuild-essential-armel \ diff --git a/docker/Dockerfile.armv5te-unknown-linux-musleabi b/docker/Dockerfile.armv5te-unknown-linux-musleabi index 5e8ef3b3b..152b3db10 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-musleabi +++ b/docker/Dockerfile.armv5te-unknown-linux-musleabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh arm diff --git a/docker/Dockerfile.armv7-linux-androideabi b/docker/Dockerfile.armv7-linux-androideabi index 3b2b2760d..fc9c8bf7f 100644 --- a/docker/Dockerfile.armv7-linux-androideabi +++ b/docker/Dockerfile.armv7-linux-androideabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh arm 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabi b/docker/Dockerfile.armv7-unknown-linux-gnueabi index 770433886..8f249dd37 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ libc6-dev-armel-cross diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index f532b8658..0c1e54282 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabihf \ libc6-dev-armhf-cross diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabi b/docker/Dockerfile.armv7-unknown-linux-musleabi index d03bddb73..b6aadf6d0 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabi +++ b/docker/Dockerfile.armv7-unknown-linux-musleabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh arm diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabihf b/docker/Dockerfile.armv7-unknown-linux-musleabihf index fb85b0285..2c282d6fc 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabihf +++ b/docker/Dockerfile.armv7-unknown-linux-musleabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh arm diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.centos new file mode 100644 index 000000000..86137653b --- /dev/null +++ b/docker/Dockerfile.centos @@ -0,0 +1,10 @@ +FROM centos:7 + +COPY common.sh lib.sh / +RUN /common.sh + +COPY cmake.sh / +RUN /cmake.sh + +COPY xargo.sh / +RUN /xargo.sh diff --git a/docker/Dockerfile.emscripten b/docker/Dockerfile.emscripten new file mode 100644 index 000000000..131d7fc4a --- /dev/null +++ b/docker/Dockerfile.emscripten @@ -0,0 +1,12 @@ +FROM emscripten/emsdk:3.1.14 +WORKDIR / +ARG DEBIAN_FRONTEND=noninteractive + +COPY common.sh lib.sh / +RUN /common.sh + +COPY cmake.sh / +RUN /cmake.sh + +COPY xargo.sh / +RUN /xargo.sh diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index 2f16f508f..39bfebc5c 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-i686-linux-gnu \ libc6-dev-i386-cross diff --git a/docker/Dockerfile.i586-unknown-linux-musl b/docker/Dockerfile.i586-unknown-linux-musl index 0c58f4ec4..80f12a0f6 100644 --- a/docker/Dockerfile.i586-unknown-linux-musl +++ b/docker/Dockerfile.i586-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY musl.sh / RUN /musl.sh TARGET=i586-linux-musl diff --git a/docker/Dockerfile.i686-linux-android b/docker/Dockerfile.i686-linux-android index 14e987e02..e159ea8d7 100644 --- a/docker/Dockerfile.i686-linux-android +++ b/docker/Dockerfile.i686-linux-android @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh x86 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.i686-pc-windows-gnu b/docker/Dockerfile.i686-pc-windows-gnu index 0d9da94c6..089559ae7 100644 --- a/docker/Dockerfile.i686-pc-windows-gnu +++ b/docker/Dockerfile.i686-pc-windows-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN dpkg --add-architecture i386 && apt-get update && \ apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev diff --git a/docker/Dockerfile.i686-unknown-freebsd b/docker/Dockerfile.i686-unknown-freebsd index b84b874aa..1f2f5d43a 100644 --- a/docker/Dockerfile.i686-unknown-freebsd +++ b/docker/Dockerfile.i686-unknown-freebsd @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN echo "export ARCH=i686" > /freebsd-arch.sh COPY freebsd-common.sh / COPY freebsd.sh / diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index aa6fe57ad..576174c77 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-i686-linux-gnu \ libc6-dev-i386-cross diff --git a/docker/Dockerfile.i686-unknown-linux-musl b/docker/Dockerfile.i686-unknown-linux-musl index 373ea9f39..f78ad94a2 100644 --- a/docker/Dockerfile.i686-unknown-linux-musl +++ b/docker/Dockerfile.i686-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY musl.sh / RUN /musl.sh TARGET=i686-linux-musl diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 4b5f4aac9..fc8be4354 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get install --assume-yes --no-install-recommends \ g++-mips-linux-gnu \ libc6-dev-mips-cross diff --git a/docker/Dockerfile.mips-unknown-linux-musl b/docker/Dockerfile.mips-unknown-linux-musl index a7c4eaaea..c2f3c7ee8 100644 --- a/docker/Dockerfile.mips-unknown-linux-musl +++ b/docker/Dockerfile.mips-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh mips diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index 585da05ef..ec0ff346f 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mips64-linux-gnuabi64 \ libc6-dev-mips64-cross diff --git a/docker/Dockerfile.mips64-unknown-linux-muslabi64 b/docker/Dockerfile.mips64-unknown-linux-muslabi64 index 3e05753c8..8fecf2240 100644 --- a/docker/Dockerfile.mips64-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-muslabi64 @@ -1,13 +1,5 @@ -FROM ubuntu:20.04 - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/ubuntu:main +ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / RUN /qemu.sh mips64 diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index eb08531f6..dee81eff8 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mips64el-linux-gnuabi64 \ libc6-dev-mips64el-cross diff --git a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 index 6b6c608af..0e858841f 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 @@ -1,13 +1,5 @@ -FROM ubuntu:20.04 - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/ubuntu:main +ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / RUN /qemu.sh mips64el diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index 564610659..9d1ad70be 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mipsel-linux-gnu \ libc6-dev-mipsel-cross diff --git a/docker/Dockerfile.mipsel-unknown-linux-musl b/docker/Dockerfile.mipsel-unknown-linux-musl index ab34456df..7a70d6aee 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-musl +++ b/docker/Dockerfile.mipsel-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh mipsel diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index d0a31737c..ac400006e 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc-linux-gnu \ libc6-dev-powerpc-cross diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index ea7196813..0ed84bc74 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc64-linux-gnu \ libc6-dev-ppc64-cross diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index ab3eb7417..ebff78c93 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc64le-linux-gnu \ libc6-dev-ppc64el-cross diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index 215d56995..d3db734ad 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install -y --no-install-recommends \ g++-riscv64-linux-gnu \ libc6-dev-riscv64-cross diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index 8bb2673d4..5b21ee045 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-s390x-linux-gnu \ libc6-dev-s390x-cross diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index 15a6ee1c5..555ea6ed2 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-sparc64-linux-gnu \ libc6-dev-sparc64-cross diff --git a/docker/Dockerfile.sparcv9-sun-solaris b/docker/Dockerfile.sparcv9-sun-solaris index 4cf2701a6..015b8262d 100644 --- a/docker/Dockerfile.sparcv9-sun-solaris +++ b/docker/Dockerfile.sparcv9-sun-solaris @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY solaris.sh / RUN /solaris.sh sparcv9 diff --git a/docker/Dockerfile.thumbv6m-none-eabi b/docker/Dockerfile.thumbv6m-none-eabi index 1fab9f068..e646a9bb0 100644 --- a/docker/Dockerfile.thumbv6m-none-eabi +++ b/docker/Dockerfile.thumbv6m-none-eabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gcc-arm-none-eabi \ diff --git a/docker/Dockerfile.thumbv7em-none-eabi b/docker/Dockerfile.thumbv7em-none-eabi index 3ef13fcfe..cb9fa5134 100644 --- a/docker/Dockerfile.thumbv7em-none-eabi +++ b/docker/Dockerfile.thumbv7em-none-eabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gcc-arm-none-eabi \ diff --git a/docker/Dockerfile.thumbv7em-none-eabihf b/docker/Dockerfile.thumbv7em-none-eabihf index aa773e620..055393c21 100644 --- a/docker/Dockerfile.thumbv7em-none-eabihf +++ b/docker/Dockerfile.thumbv7em-none-eabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gcc-arm-none-eabi \ diff --git a/docker/Dockerfile.thumbv7m-none-eabi b/docker/Dockerfile.thumbv7m-none-eabi index 4eed8f027..28e809b8f 100644 --- a/docker/Dockerfile.thumbv7m-none-eabi +++ b/docker/Dockerfile.thumbv7m-none-eabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ gcc-arm-none-eabi \ diff --git a/docker/Dockerfile.thumbv7neon-linux-androideabi b/docker/Dockerfile.thumbv7neon-linux-androideabi index 203392d52..bde974ecd 100644 --- a/docker/Dockerfile.thumbv7neon-linux-androideabi +++ b/docker/Dockerfile.thumbv7neon-linux-androideabi @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh arm 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf index d9cfbd666..6c45c82d1 100644 --- a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf +++ b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabihf \ libc6-dev-armhf-cross diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.ubuntu new file mode 100644 index 000000000..eab5f34cc --- /dev/null +++ b/docker/Dockerfile.ubuntu @@ -0,0 +1,11 @@ +FROM ubuntu:20.04 +ARG DEBIAN_FRONTEND=noninteractive + +COPY common.sh lib.sh / +RUN /common.sh + +COPY cmake.sh / +RUN /cmake.sh + +COPY xargo.sh / +RUN /xargo.sh diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index 2d040a7f0..b4ca670fe 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -1,15 +1,4 @@ -FROM emscripten/emsdk:3.1.14 -WORKDIR / -ARG DEBIAN_FRONTEND=noninteractive - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/emscripten:main RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ libxml2 \ diff --git a/docker/Dockerfile.x86_64-linux-android b/docker/Dockerfile.x86_64-linux-android index 00efc61d1..60e749726 100644 --- a/docker/Dockerfile.x86_64-linux-android +++ b/docker/Dockerfile.x86_64-linux-android @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY android-ndk.sh / RUN /android-ndk.sh x86_64 28 ENV PATH=$PATH:/android-ndk/bin diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index d2b2f1620..7dd6d576d 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN dpkg --add-architecture i386 && apt-get update && \ apt-get install --assume-yes --no-install-recommends libz-mingw-w64-dev diff --git a/docker/Dockerfile.x86_64-sun-solaris b/docker/Dockerfile.x86_64-sun-solaris index a290c31b6..e6038a8f3 100644 --- a/docker/Dockerfile.x86_64-sun-solaris +++ b/docker/Dockerfile.x86_64-sun-solaris @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY solaris.sh / RUN /solaris.sh x86_64 diff --git a/docker/Dockerfile.x86_64-unknown-dragonfly b/docker/Dockerfile.x86_64-unknown-dragonfly index 6a60522ca..cbd555721 100644 --- a/docker/Dockerfile.x86_64-unknown-dragonfly +++ b/docker/Dockerfile.x86_64-unknown-dragonfly @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY dragonfly.sh / RUN /dragonfly.sh 5 diff --git a/docker/Dockerfile.x86_64-unknown-freebsd b/docker/Dockerfile.x86_64-unknown-freebsd index ed901d87f..12dd423c1 100644 --- a/docker/Dockerfile.x86_64-unknown-freebsd +++ b/docker/Dockerfile.x86_64-unknown-freebsd @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN echo "export ARCH=x86_64" > /freebsd-arch.sh COPY freebsd-common.sh / COPY freebsd.sh / diff --git a/docker/Dockerfile.x86_64-unknown-illumos b/docker/Dockerfile.x86_64-unknown-illumos index 922cf526f..f8f957971 100644 --- a/docker/Dockerfile.x86_64-unknown-illumos +++ b/docker/Dockerfile.x86_64-unknown-illumos @@ -1,13 +1,5 @@ -FROM ubuntu:20.04 - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/ubuntu:main +ARG DEBIAN_FRONTEND=noninteractive COPY illumos.sh / RUN /illumos.sh x86_64 diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index 5e1105ef8..a9104587c 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY qemu.sh / RUN /qemu.sh x86_64 softmmu diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos index 52a8e381b..fc18966a7 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos @@ -5,16 +5,7 @@ COPY lib.sh / COPY linux-image.sh / RUN /linux-image.sh x86_64 -FROM centos:7 - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/centos:main COPY qemu.sh / RUN /qemu.sh x86_64 softmmu diff --git a/docker/Dockerfile.x86_64-unknown-linux-musl b/docker/Dockerfile.x86_64-unknown-linux-musl index 2712be924..25903efbe 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-musl +++ b/docker/Dockerfile.x86_64-unknown-linux-musl @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY musl.sh / RUN /musl.sh TARGET=x86_64-linux-musl diff --git a/docker/Dockerfile.x86_64-unknown-netbsd b/docker/Dockerfile.x86_64-unknown-netbsd index d1c89af8f..0b823e92c 100644 --- a/docker/Dockerfile.x86_64-unknown-netbsd +++ b/docker/Dockerfile.x86_64-unknown-netbsd @@ -1,15 +1,6 @@ -FROM ubuntu:20.04 +FROM ghcr.io/cross-rs/ubuntu:main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - COPY netbsd.sh / RUN /netbsd.sh diff --git a/xtask/src/util.rs b/xtask/src/util.rs index 05aa0cfaa..0ffc4bda0 100644 --- a/xtask/src/util.rs +++ b/xtask/src/util.rs @@ -302,9 +302,6 @@ pub fn read_dockerfiles(msg_info: &mut MessageInfo) -> cross::Result cross::Result<()> { - // count all the entries of FROM for our images - let mut counts = BTreeMap::new(); + use cross::shell::Verbosity; let mut msg_info = Verbosity::Verbose(2).into(); - let dockerfiles = read_dockerfiles(&mut msg_info)?; - for (path, dockerfile) in dockerfiles { - let lines: Vec<&str> = dockerfile.lines().collect(); - let index = lines - .iter() - .map(|x| x.trim()) - .position(|x| x.to_lowercase().starts_with("from")) - .ok_or_else(|| eyre::eyre!("unable to find FROM instruction for {:?}", path))?; - let tag = lines[index] - .split_whitespace() - .nth(1) - .ok_or_else(|| eyre::eyre!("invalid FROM instruction, got {}", lines[index]))?; - if let Some(value) = counts.get_mut(tag) { - *value += 1; - } else { - counts.insert(tag.to_string(), 1); - } - } - // Now, get the most common and ensure our base is correct. - let actual_base = cross::docker::UBUNTU_BASE; - let max_base = counts + let root = project_dir(&mut msg_info)?; + let docker = root.join("docker"); + let path = docker.join("Dockerfile.ubuntu"); + + let dockerfile = fs::read_to_string(&path)?; + let lines: Vec<&str> = dockerfile.lines().collect(); + let index = lines .iter() - .max_by(|x, y| x.1.cmp(y.1)) - .map(|(k, _)| k) - .ok_or_else(|| eyre::eyre!("have no dockerfiles"))?; + .map(|x| x.trim()) + .position(|x| x.to_lowercase().starts_with("from")) + .ok_or_else(|| eyre::eyre!("unable to find FROM instruction for {:?}", path))?; + let dockerfile_base = lines[index] + .split_whitespace() + .nth(1) + .ok_or_else(|| eyre::eyre!("invalid FROM instruction, got {}", lines[index]))?; - if actual_base != max_base { - eyre::bail!("most common base image is {max_base} but source code has {actual_base}") + let actual_base = cross::docker::UBUNTU_BASE; + if actual_base != dockerfile_base { + eyre::bail!("base image is {dockerfile_base} but source code has {actual_base}") } else { Ok(()) } From 3342f64fd654e4c3f76361899219600ba2416249 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Fri, 30 Sep 2022 09:44:07 -0500 Subject: [PATCH 02/11] Attempt saving to tarball. --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97df737ef..5e24e25e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,6 +160,19 @@ jobs: LATEST: ${{ needs.check.outputs.is-latest || 'false' }} shell: bash + - name: Save Docker Image + id: save-docker-image + uses: docker/metadata-action@v4 + run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}.tar" + env: + IMAGE: ${{ matrix.image }} + TAG: ${{ github.ref.name }} + + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.image }}-image-tarball + path: ${{ matrix.image }}-${{ github.ref.name }}.tar + - uses: ./.github/actions/cargo-install-upload-artifacts if: matrix.deploy with: From cab75b02c1655a666445c4b4c15acd63bb12c45c Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Fri, 30 Sep 2022 09:45:25 -0500 Subject: [PATCH 03/11] Fix save action. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e24e25e8..cccbe3f44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,6 @@ jobs: - name: Save Docker Image id: save-docker-image - uses: docker/metadata-action@v4 run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}.tar" env: IMAGE: ${{ matrix.image }} From b96d646dfbf268efdc397f18104e089e7739382f Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Fri, 30 Sep 2022 10:02:58 -0500 Subject: [PATCH 04/11] Try fixing tag. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cccbe3f44..a47854d8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,12 +165,12 @@ jobs: run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}.tar" env: IMAGE: ${{ matrix.image }} - TAG: ${{ github.ref.name }} + TAG: ${{ env.GITHUB_REF_NAME }} - uses: actions/upload-artifact@v2 with: name: ${{ matrix.image }}-image-tarball - path: ${{ matrix.image }}-${{ github.ref.name }}.tar + path: ${{ matrix.image }}-${{ env.GITHUB_REF_NAME }}.tar - uses: ./.github/actions/cargo-install-upload-artifacts if: matrix.deploy From 88e96021a87390d6668707a0b202899e173e0e6a Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sun, 2 Oct 2022 10:05:37 -0500 Subject: [PATCH 05/11] Fixes. --- .github/workflows/ci.yml | 33 +++++++++---------- docker/Dockerfile.aarch64-linux-android | 2 +- docker/Dockerfile.aarch64-unknown-linux-gnu | 2 +- docker/Dockerfile.aarch64-unknown-linux-musl | 2 +- docker/Dockerfile.arm-linux-androideabi | 2 +- docker/Dockerfile.arm-unknown-linux-gnueabi | 2 +- docker/Dockerfile.arm-unknown-linux-gnueabihf | 2 +- docker/Dockerfile.arm-unknown-linux-musleabi | 2 +- .../Dockerfile.arm-unknown-linux-musleabihf | 2 +- .../Dockerfile.armv5te-unknown-linux-gnueabi | 2 +- .../Dockerfile.armv5te-unknown-linux-musleabi | 2 +- docker/Dockerfile.armv7-linux-androideabi | 2 +- docker/Dockerfile.armv7-unknown-linux-gnueabi | 2 +- .../Dockerfile.armv7-unknown-linux-gnueabihf | 2 +- .../Dockerfile.armv7-unknown-linux-musleabi | 2 +- .../Dockerfile.armv7-unknown-linux-musleabihf | 2 +- docker/Dockerfile.i586-unknown-linux-gnu | 2 +- docker/Dockerfile.i586-unknown-linux-musl | 2 +- docker/Dockerfile.i686-linux-android | 2 +- docker/Dockerfile.i686-pc-windows-gnu | 2 +- docker/Dockerfile.i686-unknown-freebsd | 2 +- docker/Dockerfile.i686-unknown-linux-gnu | 2 +- docker/Dockerfile.i686-unknown-linux-musl | 2 +- docker/Dockerfile.mips-unknown-linux-gnu | 2 +- docker/Dockerfile.mips-unknown-linux-musl | 2 +- .../Dockerfile.mips64-unknown-linux-gnuabi64 | 2 +- .../Dockerfile.mips64-unknown-linux-muslabi64 | 2 +- ...Dockerfile.mips64el-unknown-linux-gnuabi64 | 2 +- ...ockerfile.mips64el-unknown-linux-muslabi64 | 2 +- docker/Dockerfile.mipsel-unknown-linux-gnu | 2 +- docker/Dockerfile.mipsel-unknown-linux-musl | 2 +- docker/Dockerfile.powerpc-unknown-linux-gnu | 2 +- docker/Dockerfile.powerpc64-unknown-linux-gnu | 2 +- .../Dockerfile.powerpc64le-unknown-linux-gnu | 2 +- docker/Dockerfile.riscv64gc-unknown-linux-gnu | 2 +- docker/Dockerfile.s390x-unknown-linux-gnu | 2 +- docker/Dockerfile.sparc64-unknown-linux-gnu | 2 +- docker/Dockerfile.sparcv9-sun-solaris | 2 +- docker/Dockerfile.thumbv6m-none-eabi | 2 +- docker/Dockerfile.thumbv7em-none-eabi | 2 +- docker/Dockerfile.thumbv7em-none-eabihf | 2 +- docker/Dockerfile.thumbv7m-none-eabi | 2 +- .../Dockerfile.thumbv7neon-linux-androideabi | 2 +- ...erfile.thumbv7neon-unknown-linux-gnueabihf | 2 +- docker/Dockerfile.wasm32-unknown-emscripten | 2 +- docker/Dockerfile.x86_64-linux-android | 2 +- docker/Dockerfile.x86_64-pc-windows-gnu | 2 +- docker/Dockerfile.x86_64-sun-solaris | 2 +- docker/Dockerfile.x86_64-unknown-dragonfly | 2 +- docker/Dockerfile.x86_64-unknown-freebsd | 2 +- docker/Dockerfile.x86_64-unknown-illumos | 2 +- docker/Dockerfile.x86_64-unknown-linux-gnu | 2 +- ...Dockerfile.x86_64-unknown-linux-gnu.centos | 2 +- docker/Dockerfile.x86_64-unknown-linux-musl | 2 +- docker/Dockerfile.x86_64-unknown-netbsd | 2 +- 55 files changed, 70 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a47854d8f..7ec7fa5f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,11 +107,12 @@ jobs: fail-fast: false matrix: image: + - base + sub: - ubuntu - centos - emscripten outputs: - images: ${{ steps.build-docker-image.outputs.images && fromJSON(steps.build-docker-image.outputs.images) }} coverage-artifact: ${{ steps.cov.outputs.artifact-name }} steps: - uses: actions/checkout@v3 @@ -128,15 +129,16 @@ jobs: - name: Prepare Meta id: prepare-meta timeout-minutes: 60 - run: cargo xtask ci-job prepare-meta "${IMAGE}" + run: cargo xtask ci-job prepare-meta "${IMAGE}.${SUB}" env: IMAGE: ${{ matrix.image }} + SUB: ${{ matrix.sub }} shell: bash - name: LLVM instrument coverage uses: ./.github/actions/cargo-llvm-cov with: - name: cross-${{matrix.image}} + name: cross-${{matrix.image}}-${{matrix.sub}} - name: Install cross if: matrix.deploy @@ -153,30 +155,26 @@ jobs: - name: Build Docker image id: build-docker-image timeout-minutes: 60 - run: cargo xtask build-docker-image -v "${IMAGE}" + run: cargo xtask build-docker-image -v "${IMAGE}.${SUB}" env: IMAGE: ${{ matrix.image }} + SUB: ${{ matrix.sub }} LABELS: ${{ steps.docker-meta.outputs.labels }} LATEST: ${{ needs.check.outputs.is-latest || 'false' }} shell: bash - name: Save Docker Image id: save-docker-image - run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}.tar" + run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}-${SUB}.tar" env: - IMAGE: ${{ matrix.image }} - TAG: ${{ env.GITHUB_REF_NAME }} + IMAGE: ${{ matrix.image }} + SUB: ${{ matrix.sub }} + TAG: ${{ env.GITHUB_REF_NAME }} - uses: actions/upload-artifact@v2 with: - name: ${{ matrix.image }}-image-tarball - path: ${{ matrix.image }}-${{ env.GITHUB_REF_NAME }}.tar - - - uses: ./.github/actions/cargo-install-upload-artifacts - if: matrix.deploy - with: - target: ${{ matrix.image }} - image: ${{ steps.build-docker-image.outputs.image }} + name: ${{ matrix.image }}-${{ matrix.sub }}-image-tarball + path: ${{ matrix.image }}-${{ matrix.sub }}-${{ env.GITHUB_REF_NAME }}.tar - name: Login to GitHub Container Registry uses: docker/login-action@v1 @@ -190,9 +188,10 @@ jobs: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/v') ) - run: cargo xtask build-docker-image -v --push "${IMAGE}" + run: cargo xtask build-docker-image -v "${IMAGE}.${SUB}" env: - IMAGE: ${{ matrix.target }} + IMAGE: ${{ matrix.image }} + SUB: ${{ matrix.sub }} LABELS: ${{ steps.docker-meta.outputs.labels }} LATEST: ${{ needs.check.outputs.is-latest || 'false' }} shell: bash diff --git a/docker/Dockerfile.aarch64-linux-android b/docker/Dockerfile.aarch64-linux-android index 70f0a36cc..88e077c5f 100644 --- a/docker/Dockerfile.aarch64-linux-android +++ b/docker/Dockerfile.aarch64-linux-android @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index 3707344f4..1e633b9e4 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.aarch64-unknown-linux-musl b/docker/Dockerfile.aarch64-unknown-linux-musl index 685a586f7..57045e9b2 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-musl +++ b/docker/Dockerfile.aarch64-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.arm-linux-androideabi b/docker/Dockerfile.arm-linux-androideabi index 5e1a2046b..42efad13f 100644 --- a/docker/Dockerfile.arm-linux-androideabi +++ b/docker/Dockerfile.arm-linux-androideabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index 8d2d328f2..899140900 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabihf b/docker/Dockerfile.arm-unknown-linux-gnueabihf index a70437a2d..f2508ff23 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabihf +++ b/docker/Dockerfile.arm-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive ARG VERBOSE diff --git a/docker/Dockerfile.arm-unknown-linux-musleabi b/docker/Dockerfile.arm-unknown-linux-musleabi index 13856a896..04c7cc08b 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabi +++ b/docker/Dockerfile.arm-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-musleabihf b/docker/Dockerfile.arm-unknown-linux-musleabihf index 30043ffb0..2eeeb0281 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabihf +++ b/docker/Dockerfile.arm-unknown-linux-musleabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.armv5te-unknown-linux-gnueabi b/docker/Dockerfile.armv5te-unknown-linux-gnueabi index 02f47e7f8..47971c840 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv5te-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.armv5te-unknown-linux-musleabi b/docker/Dockerfile.armv5te-unknown-linux-musleabi index 152b3db10..b1fc01137 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-musleabi +++ b/docker/Dockerfile.armv5te-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.armv7-linux-androideabi b/docker/Dockerfile.armv7-linux-androideabi index fc9c8bf7f..28c16b1c4 100644 --- a/docker/Dockerfile.armv7-linux-androideabi +++ b/docker/Dockerfile.armv7-linux-androideabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabi b/docker/Dockerfile.armv7-unknown-linux-gnueabi index 8f249dd37..9033bb01a 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index 0c1e54282..b4b406715 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabi b/docker/Dockerfile.armv7-unknown-linux-musleabi index b6aadf6d0..2e5e48e3d 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabi +++ b/docker/Dockerfile.armv7-unknown-linux-musleabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabihf b/docker/Dockerfile.armv7-unknown-linux-musleabihf index 2c282d6fc..d28fab4d4 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabihf +++ b/docker/Dockerfile.armv7-unknown-linux-musleabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index 39bfebc5c..11839cb80 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.i586-unknown-linux-musl b/docker/Dockerfile.i586-unknown-linux-musl index 80f12a0f6..84bc3d72b 100644 --- a/docker/Dockerfile.i586-unknown-linux-musl +++ b/docker/Dockerfile.i586-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY musl.sh / diff --git a/docker/Dockerfile.i686-linux-android b/docker/Dockerfile.i686-linux-android index e159ea8d7..24860afd9 100644 --- a/docker/Dockerfile.i686-linux-android +++ b/docker/Dockerfile.i686-linux-android @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.i686-pc-windows-gnu b/docker/Dockerfile.i686-pc-windows-gnu index 089559ae7..64b9158c8 100644 --- a/docker/Dockerfile.i686-pc-windows-gnu +++ b/docker/Dockerfile.i686-pc-windows-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 && apt-get update && \ diff --git a/docker/Dockerfile.i686-unknown-freebsd b/docker/Dockerfile.i686-unknown-freebsd index 1f2f5d43a..662948ea4 100644 --- a/docker/Dockerfile.i686-unknown-freebsd +++ b/docker/Dockerfile.i686-unknown-freebsd @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN echo "export ARCH=i686" > /freebsd-arch.sh diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index 576174c77..84ceeb70a 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.i686-unknown-linux-musl b/docker/Dockerfile.i686-unknown-linux-musl index f78ad94a2..d3af8e697 100644 --- a/docker/Dockerfile.i686-unknown-linux-musl +++ b/docker/Dockerfile.i686-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY musl.sh / diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index fc8be4354..90925bd40 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.mips-unknown-linux-musl b/docker/Dockerfile.mips-unknown-linux-musl index c2f3c7ee8..74f7b76ac 100644 --- a/docker/Dockerfile.mips-unknown-linux-musl +++ b/docker/Dockerfile.mips-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index ec0ff346f..234b023ba 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.mips64-unknown-linux-muslabi64 b/docker/Dockerfile.mips64-unknown-linux-muslabi64 index 8fecf2240..b55598a9f 100644 --- a/docker/Dockerfile.mips64-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-muslabi64 @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index dee81eff8..c7e5804f4 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 index 0e858841f..78de507f2 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-muslabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-muslabi64 @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index 9d1ad70be..fde9c54bd 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.mipsel-unknown-linux-musl b/docker/Dockerfile.mipsel-unknown-linux-musl index 7a70d6aee..060102b30 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-musl +++ b/docker/Dockerfile.mipsel-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index ac400006e..b6f7c3ef4 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index 0ed84bc74..9a47bc631 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index ebff78c93..367fd77c4 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index d3db734ad..a98281ca1 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index 5b21ee045..b3c6b54e4 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index 555ea6ed2..5612ef3b2 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.sparcv9-sun-solaris b/docker/Dockerfile.sparcv9-sun-solaris index 015b8262d..d81dc8f13 100644 --- a/docker/Dockerfile.sparcv9-sun-solaris +++ b/docker/Dockerfile.sparcv9-sun-solaris @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY solaris.sh / diff --git a/docker/Dockerfile.thumbv6m-none-eabi b/docker/Dockerfile.thumbv6m-none-eabi index e646a9bb0..ba847f277 100644 --- a/docker/Dockerfile.thumbv6m-none-eabi +++ b/docker/Dockerfile.thumbv6m-none-eabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.thumbv7em-none-eabi b/docker/Dockerfile.thumbv7em-none-eabi index cb9fa5134..0765bc2a6 100644 --- a/docker/Dockerfile.thumbv7em-none-eabi +++ b/docker/Dockerfile.thumbv7em-none-eabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.thumbv7em-none-eabihf b/docker/Dockerfile.thumbv7em-none-eabihf index 055393c21..7a574b0b2 100644 --- a/docker/Dockerfile.thumbv7em-none-eabihf +++ b/docker/Dockerfile.thumbv7em-none-eabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.thumbv7m-none-eabi b/docker/Dockerfile.thumbv7m-none-eabi index 28e809b8f..e6beca834 100644 --- a/docker/Dockerfile.thumbv7m-none-eabi +++ b/docker/Dockerfile.thumbv7m-none-eabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.thumbv7neon-linux-androideabi b/docker/Dockerfile.thumbv7neon-linux-androideabi index bde974ecd..1c5fd4117 100644 --- a/docker/Dockerfile.thumbv7neon-linux-androideabi +++ b/docker/Dockerfile.thumbv7neon-linux-androideabi @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf index 6c45c82d1..ae615dc7e 100644 --- a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf +++ b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index b4ca670fe..90a1463be 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/emscripten:main +FROM ghcr.io/cross-rs/base:emscripten-main RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ libxml2 \ diff --git a/docker/Dockerfile.x86_64-linux-android b/docker/Dockerfile.x86_64-linux-android index 60e749726..23e2191eb 100644 --- a/docker/Dockerfile.x86_64-linux-android +++ b/docker/Dockerfile.x86_64-linux-android @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY android-ndk.sh / diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index 7dd6d576d..9692706ba 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 && apt-get update && \ diff --git a/docker/Dockerfile.x86_64-sun-solaris b/docker/Dockerfile.x86_64-sun-solaris index e6038a8f3..8155e52a2 100644 --- a/docker/Dockerfile.x86_64-sun-solaris +++ b/docker/Dockerfile.x86_64-sun-solaris @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY solaris.sh / diff --git a/docker/Dockerfile.x86_64-unknown-dragonfly b/docker/Dockerfile.x86_64-unknown-dragonfly index cbd555721..039b7c062 100644 --- a/docker/Dockerfile.x86_64-unknown-dragonfly +++ b/docker/Dockerfile.x86_64-unknown-dragonfly @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY dragonfly.sh / diff --git a/docker/Dockerfile.x86_64-unknown-freebsd b/docker/Dockerfile.x86_64-unknown-freebsd index 12dd423c1..237be41bb 100644 --- a/docker/Dockerfile.x86_64-unknown-freebsd +++ b/docker/Dockerfile.x86_64-unknown-freebsd @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive RUN echo "export ARCH=x86_64" > /freebsd-arch.sh diff --git a/docker/Dockerfile.x86_64-unknown-illumos b/docker/Dockerfile.x86_64-unknown-illumos index f8f957971..6f7448d04 100644 --- a/docker/Dockerfile.x86_64-unknown-illumos +++ b/docker/Dockerfile.x86_64-unknown-illumos @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY illumos.sh / diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index a9104587c..5ea824c77 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY qemu.sh / diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos index fc18966a7..1b828a5a2 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu.centos @@ -5,7 +5,7 @@ COPY lib.sh / COPY linux-image.sh / RUN /linux-image.sh x86_64 -FROM ghcr.io/cross-rs/centos:main +FROM ghcr.io/cross-rs/base:centos-main COPY qemu.sh / RUN /qemu.sh x86_64 softmmu diff --git a/docker/Dockerfile.x86_64-unknown-linux-musl b/docker/Dockerfile.x86_64-unknown-linux-musl index 25903efbe..0666ae311 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-musl +++ b/docker/Dockerfile.x86_64-unknown-linux-musl @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY musl.sh / diff --git a/docker/Dockerfile.x86_64-unknown-netbsd b/docker/Dockerfile.x86_64-unknown-netbsd index 0b823e92c..02e8aa206 100644 --- a/docker/Dockerfile.x86_64-unknown-netbsd +++ b/docker/Dockerfile.x86_64-unknown-netbsd @@ -1,4 +1,4 @@ -FROM ghcr.io/cross-rs/ubuntu:main +FROM ghcr.io/cross-rs/base:ubuntu-main ARG DEBIAN_FRONTEND=noninteractive COPY netbsd.sh / From 73a34c4ad59140394a9ffd01ba1c87a3973865a1 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sun, 2 Oct 2022 10:11:17 -0500 Subject: [PATCH 06/11] Make publish and conclusion dependent on build-base. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ec7fa5f9..58c9580d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -445,7 +445,7 @@ jobs: shell: bash publish: - needs: [build, check, fmt, clippy, cargo-deny] + needs: [build-base, build, check, fmt, clippy, cargo-deny] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -456,7 +456,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} conclusion: - needs: [shellcheck, fmt, clippy, test, generate-matrix, build, publish, check, remote, bisect, docker-in-docker, foreign, podman] + needs: [shellcheck, fmt, clippy, test, generate-matrix, build-base, build, publish, check, remote, bisect, docker-in-docker, foreign, podman] if: always() runs-on: ubuntu-latest steps: From 3e2255f7adce1031471eb3afce7d002c895cc0ee Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Tue, 4 Oct 2022 11:33:04 -0500 Subject: [PATCH 07/11] Attempt to use docker load for base images. --- .github/workflows/ci.yml | 40 +++++++++++++++++++-- docker/Dockerfile.asmjs-unknown-emscripten | 12 +------ docker/Dockerfile.wasm32-unknown-emscripten | 1 + 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58c9580d8..2ab87742d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,7 @@ jobs: - name: Run unit tests run: cargo test --locked --all-targets --workspace --all-features timeout-minutes: 10 + check: runs-on: ubuntu-latest outputs: @@ -84,6 +85,7 @@ jobs: - uses: ./.github/actions/setup-rust - run: cargo xtask ci-job check id: check + generate-matrix: runs-on: ubuntu-latest outputs: @@ -116,7 +118,6 @@ jobs: coverage-artifact: ${{ steps.cov.outputs.artifact-name }} steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-rust - name: Set up Docker Buildx @@ -152,6 +153,7 @@ jobs: name=${{ steps.prepare-meta.outputs.image }} labels: | ${{ fromJSON(steps.prepare-meta.outputs.labels) }} + - name: Build Docker image id: build-docker-image timeout-minutes: 60 @@ -182,6 +184,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Push image to GitHub Container Registry if: > ( @@ -211,7 +214,6 @@ jobs: coverage-artifact: ${{ steps.cov.outputs.artifact-name }} steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-rust - name: Set up Docker Buildx @@ -250,6 +252,32 @@ jobs: name=${{ steps.prepare-meta.outputs.image }} labels: | ${{ fromJSON(steps.prepare-meta.outputs.labels) }} + + - name: Set env Base Image + if: steps.prepare-meta.outputs.has-image + run: | + if [[ "${SUB}" == "centos" ]]; then + echo "BASE=centos" >> "${GITHUB_ENV}" + elif [[ "${TARGET}" == *emscripten ]]; then + echo "BASE=emscripten" >> "${GITHUB_ENV}" + else + echo "BASE=ubuntu" >> "${GITHUB_ENV}" + fi + env: + TARGET: ${{ matrix.target }} + SUB: ${{ matrix.sub }} + + - uses: actions/download-artifact@v3 + if: steps.prepare-meta.outputs.has-image + with: + name: base-${{ env.BASE }}-image-tarball + path: base.tar + + - name: Load Base Image + id: load-docker-image + if: steps.prepare-meta.outputs.has-image + run: docker load "base.tar" + - name: Build Docker image id: build-docker-image if: steps.prepare-meta.outputs.has-image @@ -261,6 +289,7 @@ jobs: LABELS: ${{ steps.docker-meta.outputs.labels }} LATEST: ${{ needs.check.outputs.is-latest || 'false' }} shell: bash + - name: Set Docker image for test if: steps.prepare-meta.outputs.has-image run: | @@ -270,6 +299,7 @@ jobs: TARGET: ${{ matrix.target }} IMAGE: ${{ steps.build-docker-image.outputs.image }} shell: bash + - name: Test Image if: steps.prepare-meta.outputs.has-image && steps.prepare-meta.outputs.test-variant == 'default' run: ./ci/test.sh @@ -282,6 +312,7 @@ jobs: RUN: ${{ matrix.run }} RUNNERS: ${{ matrix.runners }} shell: bash + - uses: ./.github/actions/cargo-install-upload-artifacts if: matrix.deploy with: @@ -307,6 +338,7 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Push image to GitHub Container Registry if: > steps.prepare-meta.outputs.has-image && ( @@ -372,15 +404,18 @@ jobs: uses: ./.github/actions/cargo-llvm-cov with: name: integration-bisect + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: platforms: arm64 + - name: Set up docker buildx uses: docker/setup-buildx-action@v2 id: buildx with: install: true + - name: Run Foreign toolchain test run: ./ci/test-foreign-toolchain.sh shell: bash @@ -418,7 +453,6 @@ jobs: coverage-artifact: ${{ steps.cov.outputs.artifact-name }} steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-rust - name: Install Podman diff --git a/docker/Dockerfile.asmjs-unknown-emscripten b/docker/Dockerfile.asmjs-unknown-emscripten index 31781fcb5..f1ef644b5 100644 --- a/docker/Dockerfile.asmjs-unknown-emscripten +++ b/docker/Dockerfile.asmjs-unknown-emscripten @@ -1,16 +1,6 @@ -FROM emscripten/emsdk:3.1.14 -WORKDIR / +FROM ghcr.io/cross-rs/base:emscripten-main ARG DEBIAN_FRONTEND=noninteractive -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh - RUN apt-get update && apt-get update && apt-get install --assume-yes --no-install-recommends \ libxml2 \ python diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index 90a1463be..ffdf97eb5 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -1,4 +1,5 @@ FROM ghcr.io/cross-rs/base:emscripten-main +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ libxml2 \ From e94a634bedd2685df06dc12fe93afeb71bf15e42 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Tue, 4 Oct 2022 11:43:53 -0500 Subject: [PATCH 08/11] Fix build base image names. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ab87742d..7d9b1b499 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: COMMIT_AUTHOR: ${{ github.event.head_commit.author.username }} build-base: - name: base (${{ matrix.image }}) + name: ${{ matrix.image }} (${{ matrix.sub }}) runs-on: ubuntu-latest needs: [shellcheck, test, check] if: github.event_name == 'push' From 889d7d8c4629f216cea3a2b9c332dcfdbf215bb3 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Tue, 4 Oct 2022 11:48:00 -0500 Subject: [PATCH 09/11] Fix renaming with subs. --- docker/{Dockerfile.centos => Dockerfile.base.centos} | 0 docker/{Dockerfile.emscripten => Dockerfile.base.emscripten} | 0 docker/{Dockerfile.ubuntu => Dockerfile.base.ubuntu} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename docker/{Dockerfile.centos => Dockerfile.base.centos} (100%) rename docker/{Dockerfile.emscripten => Dockerfile.base.emscripten} (100%) rename docker/{Dockerfile.ubuntu => Dockerfile.base.ubuntu} (100%) diff --git a/docker/Dockerfile.centos b/docker/Dockerfile.base.centos similarity index 100% rename from docker/Dockerfile.centos rename to docker/Dockerfile.base.centos diff --git a/docker/Dockerfile.emscripten b/docker/Dockerfile.base.emscripten similarity index 100% rename from docker/Dockerfile.emscripten rename to docker/Dockerfile.base.emscripten diff --git a/docker/Dockerfile.ubuntu b/docker/Dockerfile.base.ubuntu similarity index 100% rename from docker/Dockerfile.ubuntu rename to docker/Dockerfile.base.ubuntu From f18b96a755740dcdef22b38020c38c16b2b3318d Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Tue, 4 Oct 2022 11:55:07 -0500 Subject: [PATCH 10/11] Fix base image tags and aarch64 centos image. --- .github/workflows/ci.yml | 8 ++++---- docker/Dockerfile.aarch64-unknown-linux-gnu.centos | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d9b1b499..24ae91a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,10 +154,11 @@ jobs: labels: | ${{ fromJSON(steps.prepare-meta.outputs.labels) }} + # always use the main branch, since we need it for the base image - name: Build Docker image id: build-docker-image timeout-minutes: 60 - run: cargo xtask build-docker-image -v "${IMAGE}.${SUB}" + run: cargo xtask build-docker-image -v --tag main "${IMAGE}.${SUB}" env: IMAGE: ${{ matrix.image }} SUB: ${{ matrix.sub }} @@ -167,16 +168,15 @@ jobs: - name: Save Docker Image id: save-docker-image - run: docker save "${IMAGE}:${TAG}" -o "${IMAGE}-${TAG}-${SUB}.tar" + run: docker save "${IMAGE}:main" -o "${IMAGE}-main-${SUB}.tar" env: IMAGE: ${{ matrix.image }} SUB: ${{ matrix.sub }} - TAG: ${{ env.GITHUB_REF_NAME }} - uses: actions/upload-artifact@v2 with: name: ${{ matrix.image }}-${{ matrix.sub }}-image-tarball - path: ${{ matrix.image }}-${{ matrix.sub }}-${{ env.GITHUB_REF_NAME }}.tar + path: ${{ matrix.image }}-main-${{ matrix.sub }}.tar - name: Login to GitHub Container Registry uses: docker/login-action@v1 diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu.centos b/docker/Dockerfile.aarch64-unknown-linux-gnu.centos index 5fef9a310..ae791dabd 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu.centos +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu.centos @@ -6,16 +6,7 @@ COPY lib.sh / COPY linux-image.sh / RUN /linux-image.sh aarch64 -FROM centos:7 - -COPY common.sh lib.sh / -RUN /common.sh - -COPY cmake.sh / -RUN /cmake.sh - -COPY xargo.sh / -RUN /xargo.sh +FROM ghcr.io/cross-rs/base:centos-main COPY qemu.sh / RUN /qemu.sh aarch64 softmmu From 270bf5504aa43524db8080dc2c2ceb04d830dcb1 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Tue, 4 Oct 2022 11:56:45 -0500 Subject: [PATCH 11/11] Fix unittests. --- xtask/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtask/src/util.rs b/xtask/src/util.rs index 0ffc4bda0..fb90737ee 100644 --- a/xtask/src/util.rs +++ b/xtask/src/util.rs @@ -343,7 +343,7 @@ mod tests { let root = project_dir(&mut msg_info)?; let docker = root.join("docker"); - let path = docker.join("Dockerfile.ubuntu"); + let path = docker.join("Dockerfile.base.ubuntu"); let dockerfile = fs::read_to_string(&path)?; let lines: Vec<&str> = dockerfile.lines().collect();