From e42c8ae04e005674edce4286960aa73d956bd823 Mon Sep 17 00:00:00 2001 From: "Vlad A. Ionescu" <446771+vladaionescu@users.noreply.github.com> Date: Mon, 27 Sep 2021 14:03:29 -0700 Subject: [PATCH] Update dind installation procedure (#2) * Update dind installation procedure. * Update CI script. * Try again... Co-authored-by: Vlad A. Ionescu --- .github/workflows/ci.yml | 18 +++++++++++------- Earthfile | 19 +++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4c7f51..9ab8469 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,16 +12,20 @@ jobs: runs-on: ubuntu-latest env: FORCE_COLOR: 1 + EARTHLY_CONVERSION_PARALLELISM: "5" EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" EARTHLY_INSTALL_ID: "earthly-lib-githubactions" steps: + - uses: earthly/actions/setup-earthly@v1 - uses: actions/checkout@v2 - - name: Download released earthly - run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" - - name: Docker Login (non fork only) - run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" + - name: Docker mirror login (non fork only) + run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + - name: Configure Earthly to use mirror (non fork only) + run: |- + earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] + + mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Get the prerelease earthly script - run: earthly --artifact github.com/earthly/earthly:main+prerelease-script/earthly ./earthly - name: Run tests - run: ./earthly --ci -P +test + run: earthly --ci -P +test diff --git a/Earthfile b/Earthfile index 9025843..7107685 100644 --- a/Earthfile +++ b/Earthfile @@ -1,8 +1,7 @@ INSTALL_DIND: COMMAND - ARG script_target=github.com/earthly/lib:main+install-dind-script - COPY "${script_target}/install-dind.sh" /tmp/install-dind.sh + COPY +install-dind-script/install-dind.sh /tmp/install-dind.sh RUN /tmp/install-dind.sh install-dind-script: @@ -11,10 +10,10 @@ install-dind-script: SAVE ARTIFACT ./install-dind.sh test: - BUILD +test-install-dind + BUILD +test-install-dind-amd64 -test-install-dind: - BUILD +test-install-dind-for-image \ +test-install-dind-amd64: + BUILD --platform=linux/amd64 +test-install-dind-for-image \ --base_image=docker:dind \ --base_image=alpine:latest \ --base_image=debian:stable \ @@ -25,10 +24,18 @@ test-install-dind: --base_image=earthly/dind:alpine \ --base_image=earthly/dind:ubuntu +test-install-dind-arm64: + BUILD --platform=linux/arm64 +test-install-dind-for-image \ + --base_image=docker:dind \ + --base_image=alpine:latest \ + --base_image=ubuntu:latest \ + --base_image=earthly/dind:alpine \ + --base_image=earthly/dind:ubuntu + test-install-dind-for-image: ARG base_image FROM "$base_image" - DO +INSTALL_DIND --script_target=./ + DO +INSTALL_DIND RUN echo " version: \"3\" services: