From 226b807c22062ae17728384835a50b0073fc0ac0 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Fri, 30 Sep 2022 08:31:53 -0500 Subject: [PATCH] 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 1e88e30a0..c3e21205f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,10 +109,97 @@ jobs: COMMIT_MESSAGE: ${{ github.event.head_commit.message }} COMMIT_AUTHOR: ${{ github.event.head_commit.author.username }} + build-base: + name: base (${{ matrix.pretty }},${{ matrix.os }}) + 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 6355809b4..90d7dc5f9 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 3d7cb1080..17fdbdbbd 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 2caef209b..3ae374b1a 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 f722fcc70..de7a72179 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 0385fe9d5..090709fb5 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 579a90dc5..3dc6da502 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 1769e78a5..aacf10ee0 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 5863e2ebf..101a1d31f 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(()) }