Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move update dockerhub readme maintenance from earthly/earthly #13

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@
packageNameTemplate: 'https://github.com/earthly/earthly',
datasourceTemplate: 'git-refs',
},
{
customType: 'regex',
fileMatch: [
'docs/dockerhub.md$',
],
matchStrings: [
'\\*\\s+\\`(?<currentValue>.+?)\\`\\n',
],
depNameTemplate: 'earthly/dind',
datasourceTemplate: 'docker',
},
],
labels: [
'renovate',
Expand Down Expand Up @@ -98,5 +109,29 @@
matchPackagePatterns: [ '*' ],
automerge: true,
},
{
// rule to update earthly/dind:alpine-* images
groupName: 'docs-dind-images',
matchPackageNames: ['earthly/dind'],
matchCurrentVersion: "/^alpine-.*/",
allowedVersions: "/^alpine-.*/",
versioning: "regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-r(?<revision>\\d+)$",
},
{
// rule to update earthly/dind:ubuntu:20.04-* images
groupName: 'docs-dind-images',
matchPackageNames: ['earthly/dind'],
matchCurrentVersion: "/^ubuntu-20\\.04-.*/",
allowedVersions: "/^ubuntu-20\\.04-.*/",
versioning: "regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$",
},
{
// rule to update earthly/dind:ubuntu:23.04-* images
groupName: 'docs-dind-images',
matchPackageNames: ['earthly/dind'],
matchCurrentVersion: "/^ubuntu-23\\.04-.*/",
allowedVersions: "/^ubuntu-23\\.04-.*/",
versioning: "regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$",
},
],
}
26 changes: 26 additions & 0 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update Docker Hub README

on:
push:
branches: [ main ]
paths: [ docs/dockerhub.md ]

jobs:
update-docker-hub-readmes:
name: update dockerhub readmes
runs-on: ubuntu-latest
env:
# Used in our github action as the token - TODO: look to change it into an input
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update DockerHub description for earthly/dind
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: earthly/dind
readme-filepath: ./docs/dockerhub.md
short-description: Earthly dind (Docker In Docker) Images
6 changes: 6 additions & 0 deletions common/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ ARG EARTHLY_REPO_VERSION

IMPORT github.com/earthly/earthly/buildkitd:$EARTHLY_REPO_VERSION AS earthly
IMPORT github.com/earthly/earthly/tests/with-docker:$EARTHLY_REPO_VERSION AS with-docker
IMPORT github.com/earthly/earthly/tests/with-docker-compose:$EARTHLY_REPO_VERSION AS with-docker-compose
IMPORT github.com/earthly/earthly/tests/with-docker-kind:$EARTHLY_REPO_VERSION AS with-docker-kind
IMPORT github.com/earthly/earthly/tests/dind-auto-install:$EARTHLY_REPO_VERSION AS dind-auto-install

# DOCKERHUB_USER is the organization name in docker hub (default: earthly)
ARG --global DOCKERHUB_USER
Expand Down Expand Up @@ -75,6 +77,7 @@ test:
# DIND_IMAGE is the full docker image name & tag to run the tests against. The image must exist in the remote docker registry
ARG DIND_IMAGE
BUILD --pass-args with-docker+all --DIND_IMAGE=$DIND_IMAGE
BUILD --pass-args dind-auto-install+test --BASE_IMAGE=$DIND_IMAGE

# build-and-test is used to build a new image and run tests against it after pushing it to registry
# this can be used on either the final image or a test image (which is differentiated by the repo and tag that is used)
Expand Down Expand Up @@ -125,6 +128,9 @@ push-new-tag-multi-platform:
alpine-kind-test:
BUILD --pass-args with-docker-kind+alpine-kind

alpine-docker-compose-test:
BUILD --pass-args with-docker-compose+all

# ubuntu-kind-test is a specific test for ubuntu, we put it in this file consolidate the IMPORT statement in one file
ubuntu-kind-test:
BUILD --pass-args with-docker-kind+ubuntu-kind
52 changes: 52 additions & 0 deletions docs/dockerhub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
The `dind` (docker-in-docker) image is designed for Earthfile targets that use the `WITH DOCKER` command.

See the ["use-earthly-dind" best-practice](https://docs.earthly.dev/best-practices#use-earthly-dind) for details.

## Tags

This image supports 3 Linux distributions:
* alpine
* ubuntu:20.04
* ubuntu:23.04

For which the current latest tags (respectively) are:
* `alpine-3.19-docker-25.0.2-r0`
* `ubuntu-20.04-docker-24.0.5-1`
* `ubuntu-23.04-docker-24.0.5-1`

For other available tags, please check out https://hub.docker.com/r/earthly/dind/tags

## Outdated Tags

* `alpine`
* `ubuntu`

## Note

The outdated `ubuntu` image is incompatible with the earthly v0.7.14 (and fixed in v0.7.15).
Correspondingly the `alpine` image at one point was also incompatible with v0.7.14, but was updated with
a backwards-compatable fix.

Users, however, are encouraged to pin to specific version tags moving forward. The unversioned tags will be left as-is
to help backwards-breaking changes.

To ease this transition, one can make use of an `IF` command that depends on the `EARTHLY_VERSION` builtin argument:

```
VERSION 0.8

dind:
FROM earthly/dind:alpine
ARG EARTHLY_VERSION
ARG SMALLEST_VERSION="$(echo -e "$EARTHLY_VERSION\nv0.7.14" | sort -V | head -n 1)"
IF [ "$SMALLEST_VERSION" = "v0.7.14" ]
# earthly is at v0.7.14 or newer, and must use the more recent dind:alpine-3.19-docker-25.0.2-r0 image
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
END

test:
FROM +dind
WITH DOCKER
RUN docker --version # old versions of earthly will get 20.10.14, and newer will get 23.0.6
END
```
1 change: 1 addition & 0 deletions os/alpine/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ build:
# this is primarly used to run against a newly, temporariy image build by +test-build
test:
BUILD --pass-args common+alpine-kind-test
BUILD --pass-args common+alpine-docker-compose-test
BUILD --pass-args common+test
Loading