diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63d9827..0be996c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: EARTHLY_CONVERSION_PARALLELISM: "5" EARTHLY_INSTALL_ID: "earthbuild-dind-githubactions" steps: + - uses: actions/checkout@v4 # The dind (common+alpine-kind-test and common+ubuntu-kind-test) detects # the host's IPv6 capability and then requires IPv6 NAT to create networks # for kind. So we load it here. @@ -42,7 +43,6 @@ jobs: - uses: earthbuild/actions-setup@main with: version: v0.8.15 - - uses: actions/checkout@v4 - name: Log in to GitHub Container Registry (non fork only) run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin if: github.event.pull_request.head.repo.full_name == github.repository diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63bdd51..736e4c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,25 +9,40 @@ jobs: name: release after merging ${{ github.head_ref }} if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'renovate/') && endsWith(github.head_ref, '-dind-image') runs-on: ubuntu-latest + permissions: + contents: read + packages: write env: FORCE_COLOR: 1 EARTHLY_CONVERSION_PARALLELISM: "5" - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-dind-githubactions" + EARTHLY_INSTALL_ID: "earthbuild-dind-githubactions" steps: - - uses: earthly/actions/setup-earthly@v1 + - uses: actions/checkout@v4 + # The dind (common+alpine-kind-test and common+ubuntu-kind-test) detects + # the host's IPv6 capability and then requires IPv6 NAT to create networks + # for kind. So we load it here. + # Ref: https://github.com/moby/moby/pull/47062 + - name: Load kernel module IPv6 NAT + run: sudo modprobe ip6table_nat + - name: Set up Docker Hub mirrors + run: | + sudo mkdir -p /etc/docker + echo '{"registry-mirrors": ["https://mirror.gcr.io", "https://public.ecr.aws"]}' | sudo tee /etc/docker/daemon.json + sudo systemctl restart docker + - name: Set up QEMU + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static binfmt-support + sudo update-binfmts --display + - uses: earthbuild/actions-setup@main with: version: v0.8.15 - - uses: actions/checkout@v4 - - name: Docker login (non fork only) + - name: Log in to container registries (non fork only) run: |- docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: 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\"]'" + docker login ghcr.io --username ${{ github.actor }} --password "${{ secrets.GITHUB_TOKEN }}" if: github.event.pull_request.head.repo.full_name == github.repository - name: Build & Push image - run: earthly --ci -P --push --org earthly-technologies --satellite dind +release --RENOVATE_BRANCH=${{github.head_ref}} + run: | + earthly --ci -P --push +release --RENOVATE_BRANCH=${{github.head_ref}} # default:ghcr.io + earthly --ci -P --push +release --RENOVATE_BRANCH=${{github.head_ref}} --CR_HOST=docker.io diff --git a/README.md b/README.md index dba2302..8062eae 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Earthly dind (Docker In Docker) Images -[![Release](https://github.com/earthly/dind/actions/workflows/release.yml/badge.svg)](https://github.com/earthly/dind/actions/workflows/release.yml) -![Docker Pulls](https://img.shields.io/docker/pulls/earthly/dind) +# EarthBuild dind (Docker In Docker) Images +[![Release](https://github.com/earthbuild/dind/actions/workflows/release.yml/badge.svg)](https://github.com/earthbuild/dind/actions/workflows/release.yml) +![Docker Pulls](https://img.shields.io/docker/pulls/earthbuild/dind) -Earthly's official [earthly/dind](https://hub.docker.com/repository/docker/earthly/dind/general) docker images. -For information on how to use these images, please refer to [docker in earthly](https://docs.earthly.dev/docs/guides/docker-in-earthly). +EarthBuilds's official [ghcr.io/earthbuild/dind](https://ghcr.io/earthbuild/dind) and [earthbuild/dind](https://hub.docker.com/r/earthlbuild/dind) container images. +For information on how to use these images, please refer to [docker in EarthBuild](https://docs.earthly.dev/docs/guides/docker-in-earthly). ## Supported Distributions @@ -19,7 +19,7 @@ Other distributions and/or base images can be used with our [dind+INSTALL](https ## How Images are Built In this repository, we maintain the OS & Docker versions that warrants releasing a new version of the image. -However, the installations of docker and other dependencies are done via an installation script that is currently maintained in [earthly/earthly](https://github.com/earthly/earthly). +However, the installations of docker and other dependencies are done via an installation script that is currently maintained in [earthbuild/earthbuild](https://github.com/earthbuild/earthbuild). ### Dependencies @@ -46,7 +46,7 @@ dependencies that will trigger new versions of the dind images such as the docke ## Testing -Images are tested by running remote test targets that are maintained in [earthly/earthly](https://github.com/earthly/earthly/tree/main/tests/with-docker). This is because these tests also help test [WITH DOCKER](https://docs.earthly.dev/docs/earthfile#with-docker) command in earthly cli. +Images are tested by running remote test targets that are maintained in [earthbuild/earthbuild](https://github.com/earthbuild/earthbuild/tree/main/tests/with-docker). This is because these tests also help test [WITH DOCKER](https://docs.earthly.dev/docs/earthfile#with-docker) command in earthly cli. Temporary images are built, pushed, and pulled as part of the test cycle. @@ -69,11 +69,11 @@ Community members do not have permissions to push a built image and run the test ## Deployment -When the relevant dependencies are updates by Renovate, new images/tags will be pushed automatically to the docker registry. +When the relevant dependencies are updated by Renovate, new images/tags will be pushed automatically to the container registries - [ghcr.io/earthbuild/dind](https://ghcr.io/earthbuild/dind) and [earthbuild/dind](https://hub.docker.com/r/earthlbuild/dind). ## Contributing -* Please report bugs as [GitHub issues](https://github.com/earthly/dind/issues). +* Please report bugs as [GitHub issues](https://github.com/earthbuild/dind/issues). * Join us on [Slack](https://earthly.dev/slack)! * Questions via GitHub issues are welcome! * PRs welcome! But please give a heads-up in a GitHub issue before starting work. If there is no GitHub issue for what you want to do, please create one. diff --git a/common/Earthfile b/common/Earthfile index 1dc50df..8b415d7 100644 --- a/common/Earthfile +++ b/common/Earthfile @@ -125,12 +125,13 @@ push-new-tag: exit 1 END END - FROM $CR_ORG/$IMAGE_NAME:$TAG_WITH_DATE + ARG --required CR_HOST + FROM $CR_HOST/$CR_ORG/$IMAGE_NAME:$TAG_WITH_DATE LET new_tag="$(echo ${TAG_WITH_DATE%-*})" IF [ "$new_tag" = "$TAG_WITH_DATE" ] RUN --no-cache echo "failed to remove date from tag $TAG_WITH_DATE" && exit 1 END - SAVE IMAGE --push $CR_ORG/$IMAGE_NAME:$new_tag + SAVE IMAGE --push $CR_HOST/$CR_ORG/$IMAGE_NAME:$new_tag # push-new-tag-multi-platform builds push-new-tag using both amd64 & arm64 platforms. push-new-tag-multi-platform: