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
TCP connection without TLS is completely insecure and can easily result
in container breakout.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
**Note:**`--privileged` is required for Docker-in-Docker to function properly, but it should be used with care as it provides full access to the host environment, as explained [in the relevant section of the Docker documentation](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities).
26
27
27
-
By default, the `dind` variants of this image add `--host=tcp://0.0.0.0:2375` (on top of the explicit default of `--host=unix:///var/run/docker.sock`) in order to allow external containers to access `dockerd` appropriately (as the following examples illustrate). If you use `--network=host` or other methods of sharing network namespaces (such as Kubernetes pods, for example), this might be a security issue. To disable this image behavior, simply override the container command or entrypoint to run `dockerd` directly (`... docker:dind dockerd ...` or `... --entrypoint dockerd docker:dind ...`).
28
+
By default, the `dind` variants of this image add `--host=tcp://0.0.0.0:2375` (on top of the explicit default of `--host=unix:///var/run/docker.sock`) via the `ENTRYPOINT` script (`/usr/local/bin/dockerd-entrypoint.sh`) in order to allow external containers to access `dockerd` without TLS.
29
+
30
+
This default `ENTRYPOINT` configuration is *INSECURE* and can easily result in *"container breakout"*, because any container inside the `dind` with network connectivity can connect to the `dind` daemon via the gateway IP and gain the root privileges on the host, not just the root privileges in the `dind` daemon container. Any process in the host, and any container in the parent Docker with network connectivy can gain the root privileges as well.
31
+
32
+
To disable this image behavior, simply override the container command or entrypoint to run `dockerd` directly (`... docker:dind dockerd ...` as shown in this document or `... --entrypoint dockerd docker:dind ...`).
28
33
29
34
## Connect to it from a second container
30
35
36
+
`/client-secret` is assumed to contain `ca.pem`, `cert.pem`, and `key.pem` here.
37
+
31
38
```console
32
-
$ docker run --rm --link some-docker:docker %%IMAGE%%:edge version
39
+
$ docker run --rm --link some-docker:docker -v /client-secret:/root/.docker \
0 commit comments