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
16 changes: 13 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,23 @@
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$',
},
{
// rule to update earthbuild/dind:ubuntu:23.04-* images
// rule to update earthbuild/dind:ubuntu:24.04-* images
groupName: 'dind-images',
matchPackageNames: [
'earthbuild/dind',
],
matchCurrentVersion: '/^ubuntu-23\\.04-.*/',
allowedVersions: '/^ubuntu-23\\.04-.*/',
matchCurrentVersion: '/^ubuntu-24\\.04-.*/',
allowedVersions: '/^ubuntu-24\\.04-.*/',
versioning: 'regex:^(?<compatibility>.*)-(?<major>\\d+\\.\\d+)-docker-(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)-(?<revision>\\d+)$',
},
{
// rule to update earthbuild/dind:ubuntu:26.04-* images
groupName: '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+)$',
},
// group all examples and docs dependency updates together (except earthly/earthly and earthbuild/dind)
Expand Down
4 changes: 2 additions & 2 deletions ast/tests/with-docker.ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@
"args": [
"+cgroup-v2-test",
"--DIND_IMG=$DIND_IMAGE",
"--DIND_IMG=earthbuild/dind:ubuntu-23.04-docker-25.0.2-1"
"--DIND_IMG=earthbuild/dind:ubuntu-26.04-docker-29.4.1-1"
],
"name": "BUILD"
}
Expand Down Expand Up @@ -968,7 +968,7 @@
"args": [
"ubuntu_img_tag",
"=",
"23.04"
"26.04"
],
"name": "ARG"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/earthfile/earthfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,9 @@ For information on using `WITH DOCKER` with podman see the [Podman guide](../gui

##### Note

For performance reasons, it is recommended to use a Docker image that already contains `dockerd`. If `dockerd` is not found, Earthly will attempt to install it.
For performance reasons, it is recommended to use a Docker image that already contains `dockerd`. If `dockerd` is not found, earth will attempt to install it.
Comment thread
janishorsts marked this conversation as resolved.

Earthly provides officially supported images such as `earthbuild/dind:alpine-3.22-docker-28.3.3-r1` and `earthbuild/dind:ubuntu-23.04-docker-25.0.2-1` to be used together with `WITH DOCKER`.
Earth provides officially supported images such as `earthbuild/dind:alpine-3.23-docker-29.1.2-r1` and `earthbuild/dind:ubuntu-26.04-docker-29.4.1-1` to be used together with `WITH DOCKER`.
Comment thread
janishorsts marked this conversation as resolved.
{% endhint %}

{% hint style='info' %}
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/docker-in-earthly.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The current implementation of Docker in Earthly has a number of limitations:
...
END
```
- It is recommended that the target containing the `WITH DOCKER` clause inherits from a supported Docker-in-Docker (dind) image such as `earthbuild/dind:alpine-3.22-docker-28.3.3-r1` or `earthbuild/dind:ubuntu-23.04-docker-25.0.2-1`. If your build requires the use of an alternative environment as part of a test (e.g. to run commands like `sbt test` or `go test` together with a docker-compose stack), consider placing the test itself in a Docker image, then loading that image via `--load` and running the test as a Docker container.
- It is recommended that the target containing the WITH DOCKER clause inherits from a supported Docker-in-Docker (dind) image such as earthbuild/dind:alpine-3.23-docker-29.1.2-r1 or earthbuild/dind:ubuntu-26.04-docker-29.4.1-1. If your build requires the use of an alternative environment as part of a test (e.g. to run commands like sbt test or go test together with a docker-compose stack), consider placing the test itself in a Docker image, then loading that image via --load and running the test as a Docker container.
- If you do not use an officially supported Docker-in-Docker image, Earthly will attempt to install Docker in whatever image you have chosen. This has the drawback of not being able to use cache efficiently and is not recommended for performance reasons.
- To maximize the use of cache, all external images used should be declared via the options `--pull` or `--compose`. Even though commands such as `docker run` automatically pull an image if it is not found locally, it will do so every single time the `WITH DOCKER` clause is executed, due to Docker caching not being preserved between runs. Pre-declaring the images ensures that they are properly cached by Earthly to minimize unnecessary redownloads.
- `docker build` cannot be used to build Dockerfiles. However, the Earthly command `FROM DOCKERFILE` can be used instead. See [alternative to docker build](#alternative-to-docker-build) below.
Expand Down
7 changes: 5 additions & 2 deletions tests/dind-auto-install/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ all:
# renovate: datasource=docker packageName=ghcr.io/earthbuild/dind
LET earthbuild_dind_ubuntu_2004_version=ubuntu-20.04-docker-28.1.1-1
# renovate: datasource=docker packageName=ghcr.io/earthbuild/dind
LET earthbuild_dind_ubuntu_2404_version=ubuntu-24.04-docker-28.3.3-1
LET earthbuild_dind_ubuntu_2404_version=ubuntu-24.04-docker-28.5.2-1
# renovate: datasource=docker packageName=ghcr.io/earthbuild/dind
LET earthbuild_dind_ubuntu_2604_version=ubuntu-26.04-docker-29.4.1-1

BUILD +test \
--BASE_IMAGE=docker:20.10.14-dind \
Expand All @@ -30,7 +32,8 @@ all:
--BASE_IMAGE=public.ecr.aws/amazonlinux/amazonlinux:$amazonlinux_2023_version \
--BASE_IMAGE=ghcr.io/earthbuild/dind:$earthbuild_dind_alpine_version \
--BASE_IMAGE=ghcr.io/earthbuild/dind:$earthbuild_dind_ubuntu_2004_version \
--BASE_IMAGE=ghcr.io/earthbuild/dind:$earthbuild_dind_ubuntu_2404_version
--BASE_IMAGE=ghcr.io/earthbuild/dind:$earthbuild_dind_ubuntu_2404_version \
--BASE_IMAGE=ghcr.io/earthbuild/dind:$earthbuild_dind_ubuntu_2604_version

test:
ARG --required BASE_IMAGE
Expand Down
10 changes: 5 additions & 5 deletions tests/with-docker-validate-labels/Earthfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Test for --without-earthly-labels feature
VERSION --allow-without-earthly-labels 0.8
VERSION --allow-without-earthly-labels 0.8

ARG --global DIND_IMAGE="earthbuild/dind:ubuntu-26.04-docker-29.4.1-1"

ARG --global DIND_IMAGE="earthbuild/dind:ubuntu-23.04-docker-25.0.2-1"

all:
BUILD +test-without-labels
BUILD +test-with-labels
Expand All @@ -20,12 +20,12 @@ myimage-with-labels:
test-without-labels:
FROM $DIND_IMAGE
WITH DOCKER --load=+myimage-without-labels
RUN docker inspect myimage:test | jq -r '.[].Config.Labels' | grep -q null
RUN docker inspect myimage:test | jq -r '.[].Config.Labels' | grep -q null
END

test-with-labels:
FROM $DIND_IMAGE
WITH DOCKER --load=+myimage-with-labels
# We just test that fields aren't null.
RUN docker inspect myimage:test | jq -e '.[].Config.Labels' > /dev/null
RUN docker inspect myimage:test | jq -e '.[].Config.Labels' > /dev/null
END
4 changes: 2 additions & 2 deletions tests/with-docker/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ if-after:
cgroup-v2-test-all:
BUILD +cgroup-v2-test \
--DIND_IMG=$DIND_IMAGE \
--DIND_IMG=earthbuild/dind:ubuntu-23.04-docker-25.0.2-1
--DIND_IMG=earthbuild/dind:ubuntu-26.04-docker-29.4.1-1

cgroup-v2-test:
ARG --required DIND_IMG
FROM $DIND_IMG
COPY test-cgroup-v2.sh test-cgroup-v2-inside-container.sh .
ARG ubuntu_img_tag=23.04
ARG ubuntu_img_tag=26.04
WITH DOCKER --pull ubuntu:$ubuntu_img_tag
RUN ./test-cgroup-v2.sh
END
Expand Down
Loading