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: docker/content.md
+1-20Lines changed: 1 addition & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Inside the directory specified by `DOCKER_TLS_CERTDIR`, the entrypoint scripts w
32
32
33
33
In order to make use of this functionality from a "client" container, at least the `client` subdirectory of the `$DOCKER_TLS_CERTDIR` directory needs to be shared (as illustrated in the following examples).
34
34
35
-
To disable this image behavior, simply override the container command or entrypoint to run `dockerd` directly (`... docker:dind dockerd ...` or `... --entrypoint dockerd docker:dind ...`).
35
+
To disable this image behavior, simply override the container command or entrypoint to run `dockerd` directly (`... %%IMAGE%%:dind dockerd ...` or `... --entrypoint dockerd %%IMAGE%%:dind ...`).
Some of these will not be supported based on the settings on the host's `dockerd`, such as `--ulimit nofile=-1`, giving errors that look like `error setting rlimit type 7: operation not permitted`, and some may inherit sane values from the host `dockerd` instance or may not apply for your usage of Docker-in-Docker (for example, you likely want to set `--oom-score-adj` to a value that's higher than `dockerd` on the host so that your Docker-in-Docker instance is killed before the host Docker instance is).
207
207
208
-
## Rootless
209
-
210
-
For more information about using the experimental "rootless" image variants, see [docker-library/docker#174](https://github.com/docker-library/docker/pull/174).
211
-
212
-
**Note:** just like the regular `dind` images, `--privileged` is required for Docker-in-Docker to function properly ([docker-library/docker#151](https://github.com/docker-library/docker/issues/151#issuecomment-483185972) & [docker-library/docker#281](https://github.com/docker-library/docker/issues/281#issuecomment-744766015)). For `19.03.x` rootless images, an argument of `--experimental` is required for `dockerd` ([docker/docker#40759](https://github.com/docker/docker/pull/40759)).
213
-
214
-
Basic example usage:
215
-
216
-
```console
217
-
$ docker run -d --name some-docker --privileged docker:dind-rootless
218
-
$ docker logs --tail=3 some-docker # to verify the daemon has finished generating TLS certificates and is listening successfully
219
-
time="xxx" level=info msg="Daemon has completed initialization"
220
-
time="xxx" level=info msg="API listen on /run/user/1000/docker.sock"
221
-
time="xxx" level=info msg="API listen on [::]:2376"
222
-
$ docker exec -it some-docker docker-entrypoint.sh sh # using "docker-entrypoint.sh" which auto-sets "DOCKER_HOST" appropriately
223
-
/ $ docker info --format '{{ json .SecurityOptions }}'
224
-
["name=seccomp,profile=default","name=rootless"]
225
-
```
226
-
227
208
## Where to Store Data
228
209
229
210
Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the `%%REPO%%` images to familiarize themselves with the options available, including:
For more information about using the experimental "rootless" image variants, see [docker-library/docker#174](https://github.com/docker-library/docker/pull/174).
4
+
5
+
**Note:** just like the regular `dind` images, `--privileged` is required for Docker-in-Docker to function properly ([docker-library/docker#151](https://github.com/docker-library/docker/issues/151#issuecomment-483185972) & [docker-library/docker#281](https://github.com/docker-library/docker/issues/281#issuecomment-744766015)), which is a security issue that needs to be treated appropriately.
6
+
7
+
Basic example usage:
8
+
9
+
```console
10
+
$ docker run -d --name some-docker --privileged %%IMAGE%%:dind-rootless
11
+
$ docker logs --tail=3 some-docker # to verify the daemon has finished generating TLS certificates and is listening successfully
12
+
time="xxx" level=info msg="Daemon has completed initialization"
13
+
time="xxx" level=info msg="API listen on /run/user/1000/docker.sock"
14
+
time="xxx" level=info msg="API listen on [::]:2376"
15
+
$ docker exec -it some-docker docker-entrypoint.sh sh # using "docker-entrypoint.sh" which auto-sets "DOCKER_HOST" appropriately
16
+
/ $ docker info --format '{{ json .SecurityOptions }}'
17
+
["name=seccomp,profile=default","name=rootless"]
18
+
```
19
+
20
+
To run with a different UID/GID than the one baked into the image, modify `/etc/passwd`, `/etc/group`, and filesystem permissions (especially for the `rootless` user's home directory) as appropriate; for example:
21
+
22
+
```dockerfile
23
+
FROM %%IMAGE%%:dind-rootless
24
+
USER root
25
+
RUN set -eux; \
26
+
sed -i -e 's/^rootless:1000:1000:/rootless:1234:5678:/' /etc/passwd; \
27
+
sed -i -e 's/^rootless:1000:/:5678:/' /etc/group; \
0 commit comments