You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/basics/part-6-using-docker-with-earthly.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ Examples in [Python](#more-examples), [JavaScript](#more-examples) and [Java](#m
10
10
11
11
You may find that you need to run Docker commands inside a target. For those cases Earthly offers `WITH DOCKER`. `WITH DOCKER` will initialize a Docker daemon that can be used in the context of a `RUN` command.
12
12
13
-
Whenever you need to use `WITH DOCKER` we recommend (though it is not required) that you use Earthly's own Docker in Docker (dind) image: `earthly/dind:alpine-3.19-docker-25.0.2-r0`.
13
+
Whenever you need to use `WITH DOCKER` we recommend (though it is not required) that you use Earthly's own Docker in Docker (dind) image: `earthly/dind:alpine-3.20-docker-26.1.3-r1`.
14
14
15
-
Notice `WITH DOCKER` creates a block of code that has an `END` keyword. Everything that happens within this block is going to take place within our `earthly/dind:alpine-3.19-docker-25.0.2-r0` container.
15
+
Notice `WITH DOCKER` creates a block of code that has an `END` keyword. Everything that happens within this block is going to take place within our `earthly/dind:alpine-3.20-docker-26.1.3-r1` container.
16
16
17
17
### Pulling an Image
18
18
```Dockerfile
19
19
hello:
20
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
20
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
21
21
WITH DOCKER --pull hello-world
22
22
RUN docker run hello-world
23
23
END
@@ -35,7 +35,7 @@ my-hello-world:
35
35
SAVE IMAGE my-hello:latest
36
36
37
37
hello:
38
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
38
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
39
39
WITH DOCKER --load hello:latest=+my-hello-world
40
40
RUN docker run hello:latest
41
41
END
@@ -137,7 +137,7 @@ test-setup:
137
137
SAVE IMAGE test:latest
138
138
139
139
integration-tests:
140
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
140
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
141
141
COPY docker-compose.yml ./
142
142
WITH DOCKER --compose docker-compose.yml --load tests:latest=+test-setup
143
143
RUN docker run --network=default_go/part6_default tests:latest
Copy file name to clipboardExpand all lines: docs/earthfile/earthfile.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1100,7 +1100,7 @@ The `WITH DOCKER` clause only supports the command [`RUN`](#run). Other commands
1100
1100
A typical example of a `WITH DOCKER` clause might be:
1101
1101
1102
1102
```Dockerfile
1103
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
1103
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
1104
1104
WORKDIR /test
1105
1105
COPY docker-compose.yml ./
1106
1106
WITH DOCKER \
@@ -1122,7 +1122,7 @@ For information on using `WITH DOCKER` with podman see the [Podman guide](../gui
1122
1122
##### Note
1123
1123
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.
1124
1124
1125
-
Earthly provides officially supported images such as `earthly/dind:alpine-3.19-docker-25.0.2-r0` and `earthly/dind:ubuntu-23.04-docker-24.0.5-1` to be used together with `WITH DOCKER`.
1125
+
Earthly provides officially supported images such as `earthly/dind:alpine-3.20-docker-26.1.3-r1` and `earthly/dind:ubuntu-23.04-docker-25.0.2-1` to be used together with `WITH DOCKER`.
Copy file name to clipboardExpand all lines: docs/guides/docker-in-earthly.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,15 @@ Here is a quick example of running a `hello-world` docker container via `docker
11
11
12
12
```Dockerfile
13
13
hello:
14
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
14
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
15
15
WITH DOCKER --pull hello-world
16
16
RUN docker run hello-world
17
17
END
18
18
```
19
19
20
20
Let's break it down.
21
21
22
-
`FROM earthly/dind:alpine-3.19-docker-25.0.2-r0` inherits from an Earthly-supported docker-in-docker (dind) image. This is recommended, because `WITH DOCKER` requires all the Docker binaries (not just the client) to be present in the build environment.
22
+
`FROM earthly/dind:alpine-3.20-docker-26.1.3-r1` inherits from an Earthly-supported docker-in-docker (dind) image. This is recommended, because `WITH DOCKER` requires all the Docker binaries (not just the client) to be present in the build environment.
23
23
24
24
`WITH DOCKER ... END` starts a Docker daemon for the purpose of running Docker commands against it. At the end of the execution, this also terminates the daemon and permanently deletes all of its data (e.g. daemon cached images).
25
25
@@ -38,7 +38,7 @@ build:
38
38
SAVE IMAGE my-image:latest
39
39
40
40
smoke-test:
41
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
41
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
42
42
WITH DOCKER --load test:latest=+build
43
43
RUN docker run test:latest
44
44
FROM earthly/dind:alpine
@@ -54,7 +54,7 @@ smoke-test:
54
54
It is possible to run `docker-compose` via `WITH DOCKER`, either explicitly, simply by running the `docker-compose` tool, or implicitly, via the `--compose` flag. The `--compose` flag allows you to specify a Docker compose stack that needs to be brought up before the execution of the `RUN` command. For example:
55
55
56
56
```Dockerfile
57
-
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
57
+
FROM earthly/dind:alpine-3.20-docker-26.1.3-r1
58
58
COPY docker-compose.yml ./
59
59
WITH DOCKER \
60
60
--compose docker-compose.yml \
@@ -68,7 +68,7 @@ Using the `--compose` flag has the added benefit that any images needed by the c
68
68
69
69
## Performance
70
70
71
-
It's recommended to use the `earthly/dind:alpine-3.19-docker-25.0.2-r0` image for running docker-in-docker. See the best-practices' section on using [with docker](../guides/best-practices.md#use-earthly-dind) for more details.
71
+
It's recommended to use the `earthly/dind:alpine-3.20-docker-26.1.3-r1` image for running docker-in-docker. See the best-practices' section on using [with docker](../guides/best-practices.md#use-earthly-dind) for more details.
72
72
73
73
In cases when using `earthly/dind` is not possible, Earthly will attempt to install Docker in the image you have chosen. This has the drawback of not being able to use cache efficiently and is not recommended for performance reasons.
74
74
@@ -102,7 +102,7 @@ The current implementation of Docker in Earthly has a number of limitations:
102
102
...
103
103
END
104
104
```
105
-
* It is recommended that the target containing the `WITH DOCKER` clause inherits from a supported Docker-in-Docker (dind) image such as `earthly/dind:alpine-3.19-docker-25.0.2-r0` or `earthly/dind:ubuntu-23.04-docker-24.0.5-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.
105
+
* It is recommended that the target containing the `WITH DOCKER` clause inherits from a supported Docker-in-Docker (dind) image such as `earthly/dind:alpine-3.20-docker-26.1.3-r1` or `earthly/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.
106
106
* 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.
107
107
* 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.
108
108
*`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.
0 commit comments