Skip to content
Draft
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
108 changes: 34 additions & 74 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'/Earthfile/',
],
matchStrings: [
'\\s*#\\s*renovate:\\s*datasource=(?<datasource>.*?)\\s+depName=(?<depName>.*?)[\\s\\n]+(versioning=(?<versioning>.*?)\\s+)?(ARG|LET)\\s+.*?(_VERSION|_VER|version)=(?<currentValue>.*?)($|\\s|\\n)',
'\\s*#\\s*renovate:\\s*datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)(?:\\s+packageName=(?<packageName>\\S+))?[\\s\\n]+(versioning=(?<versioning>\\S+)\\s+)?(ARG|LET)\\s+.*?(_VERSION|_VER|version)=(?<currentValue>.*?)($|\\s|\\n)',
],
},
{
Expand All @@ -40,99 +40,59 @@
'/^README.md$/',
],
matchStrings: [
'\\*\\s+\\`(?<currentValue>.+?)\\`\\n',
'\\*\\s+\\`alpine-3\\.22-docker-(?<currentValue>.*?)\\`\\n',
],
depNameTemplate: 'earthbuild/dind',
datasourceTemplate: 'docker',
depNameTemplate: 'alpine_3_22/docker',
datasourceTemplate: 'repology',
versioningTemplate: 'loose',
},
],
labels: [
'renovate',
],
packageRules: [
{
groupName: "{{{ replace 'os\\/(.*?)$' '$1' packageFileDir}}}-dind-image",
matchManagers: [
'custom.regex',
customType: 'regex',
managerFilePatterns: [
'/^README.md$/',
],
matchDatasources: [
'docker',
'repology',
'github-releases',
matchStrings: [
'\\*\\s+\\`alpine-3\\.23-docker-(?<currentValue>.*?)\\`\\n',
],
matchFileNames: [
'os/**/Earthfile',
depNameTemplate: 'alpine_3_23/docker',
datasourceTemplate: 'repology',
versioningTemplate: 'loose',
},
{
customType: 'regex',
managerFilePatterns: [
'/^README.md$/',
],
matchPackageNames: [
'/alpine/',
'/alpine.*?/docker/',
'moby/moby',
matchStrings: [
'\\*\\s+\\`ubuntu-(?<osVersion>\\d+\\.\\d+)-docker-(?<currentValue>.*?)-\\d+\\`\\n',
],
depNameTemplate: 'moby/moby-{{{osVersion}}}',
packageNameTemplate: 'moby/moby',
datasourceTemplate: 'github-releases',
versioningTemplate: 'semver-coerced',
},
],
labels: [
'renovate',
],
packageRules: [
{
// Lock docker to v28.1.1 for Ubuntu 20.04.
matchFileNames: [
'os/ubuntu-20.04/Earthfile',
],
matchPackageNames: [
'moby/moby',
// Lock docker to v28.1.1 for Ubuntu 20.04 and disable updates.
matchDepNames: [
'moby/moby-20.04',
],
allowedVersions: '28.1.1',
enabled: false,
},
{
automerge: true,
matchPackageNames: [
'*',
],
},
{
groupName: 'docs-dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^alpine-3\\.22-.*/',
allowedVersions: '/^alpine-3\\.22-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-r(?<revision>\\d+)$',
},
{
groupName: 'docs-dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^alpine-3\\.23-.*/',
allowedVersions: '/^alpine-3\\.23-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-r(?<revision>\\d+)$',
},
{
groupName: 'docs-dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^ubuntu-20\\.04-.*/',
allowedVersions: '/^ubuntu-20\\.04-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$',
},
{
groupName: 'docs-dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^ubuntu-24\\.04-.*/',
allowedVersions: '/^ubuntu-24\\.04-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$',
},
{
groupName: 'docs-dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^ubuntu-26\\.04-.*/',
allowedVersions: '/^ubuntu-26\\.04-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$',
},
{
matchPackageNames: [
'moby/moby',
'/^moby\\/moby/',
],
matchDatasources: [
'github-releases',
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
test:
name: test (${{ matrix.os }})
strategy:

matrix:
os:
- alpine-3.22
Expand All @@ -32,9 +31,7 @@ jobs:
contents: read
packages: write
env:
FORCE_COLOR: 1
EARTHLY_CONVERSION_PARALLELISM: "5"
EARTHLY_INSTALL_ID: "earthbuild-dind-githubactions"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# The dind (common+alpine-kind-test and common+ubuntu-kind-test) detects
Expand Down
38 changes: 27 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: Release

on:
pull_request_target:
types: [ closed ]
push:
branches:
- main
paths:
- 'os/**/Earthfile'
- 'README.md'

jobs:
release:
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')
name: release after merge
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
FORCE_COLOR: 1
EARTHLY_CONVERSION_PARALLELISM: "5"
EARTHLY_INSTALL_ID: "earthbuild-dind-githubactions"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
# 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.
Expand All @@ -40,10 +43,23 @@ jobs:
run: |-
docker login --username "${{ vars.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}"
docker login ghcr.io --username ${{ github.actor }} --password "${{ secrets.GITHUB_TOKEN }}"
if: github.event.pull_request.head.repo.full_name == github.repository
if: github.repository == 'earthbuild/dind'
- name: Build & Push image
env:
RENOVATE_BRANCH: ${{ github.head_ref }}
run: |
earth --ci -P --push +release --RENOVATE_BRANCH="$RENOVATE_BRANCH" # default:ghcr.io
earth --ci -P --push +release --RENOVATE_BRANCH="$RENOVATE_BRANCH" --CR_HOST=docker.io
# Detect changed Earthfiles
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} || git diff --name-only HEAD^ HEAD || true)
echo "Changed files: $CHANGED_FILES"

# Extract unique OS names
OS_LIST=$(echo "$CHANGED_FILES" | grep '^os/.*/Earthfile$' | awk -F'/' '{print $2}' | sort -u || true)

if [ -z "$OS_LIST" ]; then
echo "No OS Earthfiles changed. Skipping build."
exit 0
fi

for OS in $OS_LIST; do
echo "Releasing OS: $OS"
earth --ci -P --push +release --OS="$OS" # default:ghcr.io
earth --ci -P --push +release --OS="$OS" --CR_HOST=docker.io
done
11 changes: 2 additions & 9 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ test:
ARG --required OS
BUILD --pass-args ./os/$OS+test-build

# release expects to get a renovate branch in the form of renovate/<os>-dind-image, extracts the os and then kicks off its +release target
# release builds and pushes the image for a specific OS
# this is meant to be run by a github workflow
release:
FROM alpine:3.23.4@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11
# RENOVATE_BRANCH is the renovate branch that is expected to get merged and trigger this target
ARG --required RENOVATE_BRANCH
LET os=${RENOVATE_BRANCH#renovate/}
# remove major-XX- or major-
SET os=$(echo ${os#major-[[:digit:]]?-})
SET os=${os#major-}
# using a LET/SET in the target path does not work, use an ARG instead until it's fixed
ARG OS=${os%-dind-image}
ARG --required OS
Comment thread
janishorsts marked this conversation as resolved.
BUILD --pass-args ./os/$OS+release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For which the current latest tags (respectively) are:
* `alpine-3.23-docker-29.1.2-r1`
* `ubuntu-20.04-docker-28.1.1-1`
* `ubuntu-24.04-docker-28.5.1-1`
* `ubuntu-26.04-docker-29.4.1-1`
* `ubuntu-26.04-docker-29.4.0-1`

For other available tags, please check out [ghcr.io/earthbuild/dind](https://github.com/earthbuild/dind/pkgs/container/dind/versions?filters%5Bversion_type%5D=tagged) or [earthbuild/dind](https://hub.docker.com/r/earthbuild/dind/tags).

2 changes: 1 addition & 1 deletion os/ubuntu-20.04/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMPORT ../../common AS common
ARG --global OS_IMAGE=ubuntu

ARG --global OS_VERSION=20.04
# renovate: datasource=github-releases depName=moby/moby
# renovate: datasource=github-releases depName=moby/moby-20.04 packageName=moby/moby
LET docker_package_version=28.1.1
ARG --global DOCKER_VERSION=5:$docker_package_version-1~ubuntu.$OS_VERSION~focal

Expand Down
2 changes: 1 addition & 1 deletion os/ubuntu-24.04/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMPORT ../../common AS common
ARG --global OS_IMAGE=ubuntu

ARG --global OS_VERSION=24.04
# renovate: datasource=github-releases depName=moby/moby
# renovate: datasource=github-releases depName=moby/moby-24.04 packageName=moby/moby
LET docker_package_version=28.5.2
ARG --global DOCKER_VERSION=5:$docker_package_version-1~ubuntu.$OS_VERSION~noble

Expand Down
4 changes: 2 additions & 2 deletions os/ubuntu-26.04/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ IMPORT ../../common AS common
ARG --global OS_IMAGE=ubuntu

ARG --global OS_VERSION=26.04
# renovate: datasource=github-releases depName=moby/moby
LET docker_package_version=29.4.1
# renovate: datasource=github-releases depName=moby/moby-26.04 packageName=moby/moby
LET docker_package_version=29.4.0
Comment thread
janishorsts marked this conversation as resolved.
ARG --global DOCKER_VERSION=5:$docker_package_version-1~ubuntu.$OS_VERSION~resolute

# DIR_PATH is set to that common targets can call os specific targets. It should match the directory name this Earthfile is located in
Expand Down