Skip to content

Commit

Permalink
Update dind installation procedure (#2)
Browse files Browse the repository at this point in the history
* Update dind installation procedure.

* Update CI script.

* Try again...

Co-authored-by: Vlad A. Ionescu <[email protected]>
  • Loading branch information
vladaionescu and vladaionescu authored Sep 27, 2021
1 parent 044b19f commit e42c8ae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 13 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 \
Expand All @@ -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:
Expand Down

0 comments on commit e42c8ae

Please sign in to comment.