Skip to content

Commit 1aa5fc0

Browse files
Run Docker DinD with TLS enabled:
This mitigates the Docker host from allowing remote connections. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 0710b0d commit 1aa5fc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

images/hook-docker/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func run() error {
6363
myEnvs = append(myEnvs, fmt.Sprintf("HTTP_PROXY=%s", cfg.httpProxy))
6464
myEnvs = append(myEnvs, fmt.Sprintf("HTTPS_PROXY=%s", cfg.httpsProxy))
6565
myEnvs = append(myEnvs, fmt.Sprintf("NO_PROXY=%s", cfg.noProxy))
66+
// We set this so that the dockerd-entrypoint.sh will run docker with TLS enabled.
67+
// This is needed as the docker daemon is listening on 0.0.0.0 and it's not straightforward
68+
// to reconfigure this. Enabling TLS will block remote access to the docker daemon for now.
69+
myEnvs = append(myEnvs, "DOCKER_TLS_CERTDIR=/certs")
6670

6771
cmd.Env = append(os.Environ(), myEnvs...)
6872

0 commit comments

Comments
 (0)