Skip to content
Merged
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: 10 additions & 6 deletions 18.09-rc/dind/dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ _tls_generate_certs() {
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# set DOCKER_HOST to the default "--host" value (for both standard or rootless)
# set "dockerSocket" to the default "--host" *unix socket* value (for both standard or rootless)
uid="$(id -u)"
if [ "$uid" = '0' ]; then
: "${DOCKER_HOST:=unix:///var/run/docker.sock}"
dockerSocket='unix:///var/run/docker.sock'
else
# if we're not root, we must be trying to run rootless
: "${XDG_RUNTIME_DIR:=/run/user/$uid}"
: "${DOCKER_HOST:=unix://$XDG_RUNTIME_DIR/docker.sock}"
dockerSocket="unix://$XDG_RUNTIME_DIR/docker.sock"
fi
export DOCKER_HOST
case "${DOCKER_HOST:-}" in
unix://*)
dockerSocket="$DOCKER_HOST"
;;
esac

# add our default arguments
if [ -n "${DOCKER_TLS_CERTDIR:-}" ] \
Expand All @@ -112,7 +116,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
; then
# generate certs and use TLS if requested/possible (default in 19.03+)
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2376 \
--tlsverify \
--tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \
Expand All @@ -123,7 +127,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
else
# TLS disabled (-e DOCKER_TLS_CERTDIR='') or missing certs
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2375 \
"$@"
DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp"
Expand Down
16 changes: 10 additions & 6 deletions 18.09/dind/dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ _tls_generate_certs() {
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# set DOCKER_HOST to the default "--host" value (for both standard or rootless)
# set "dockerSocket" to the default "--host" *unix socket* value (for both standard or rootless)
uid="$(id -u)"
if [ "$uid" = '0' ]; then
: "${DOCKER_HOST:=unix:///var/run/docker.sock}"
dockerSocket='unix:///var/run/docker.sock'
else
# if we're not root, we must be trying to run rootless
: "${XDG_RUNTIME_DIR:=/run/user/$uid}"
: "${DOCKER_HOST:=unix://$XDG_RUNTIME_DIR/docker.sock}"
dockerSocket="unix://$XDG_RUNTIME_DIR/docker.sock"
fi
export DOCKER_HOST
case "${DOCKER_HOST:-}" in
unix://*)
dockerSocket="$DOCKER_HOST"
;;
esac

# add our default arguments
if [ -n "${DOCKER_TLS_CERTDIR:-}" ] \
Expand All @@ -112,7 +116,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
; then
# generate certs and use TLS if requested/possible (default in 19.03+)
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2376 \
--tlsverify \
--tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \
Expand All @@ -123,7 +127,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
else
# TLS disabled (-e DOCKER_TLS_CERTDIR='') or missing certs
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2375 \
"$@"
DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp"
Expand Down
16 changes: 10 additions & 6 deletions 19.03-rc/dind/dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ _tls_generate_certs() {
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# set DOCKER_HOST to the default "--host" value (for both standard or rootless)
# set "dockerSocket" to the default "--host" *unix socket* value (for both standard or rootless)
uid="$(id -u)"
if [ "$uid" = '0' ]; then
: "${DOCKER_HOST:=unix:///var/run/docker.sock}"
dockerSocket='unix:///var/run/docker.sock'
else
# if we're not root, we must be trying to run rootless
: "${XDG_RUNTIME_DIR:=/run/user/$uid}"
: "${DOCKER_HOST:=unix://$XDG_RUNTIME_DIR/docker.sock}"
dockerSocket="unix://$XDG_RUNTIME_DIR/docker.sock"
fi
export DOCKER_HOST
case "${DOCKER_HOST:-}" in
unix://*)
dockerSocket="$DOCKER_HOST"
;;
esac

# add our default arguments
if [ -n "${DOCKER_TLS_CERTDIR:-}" ] \
Expand All @@ -112,7 +116,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
; then
# generate certs and use TLS if requested/possible (default in 19.03+)
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2376 \
--tlsverify \
--tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \
Expand All @@ -123,7 +127,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
else
# TLS disabled (-e DOCKER_TLS_CERTDIR='') or missing certs
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2375 \
"$@"
DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp"
Expand Down
16 changes: 10 additions & 6 deletions 19.03/dind/dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ _tls_generate_certs() {
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# set DOCKER_HOST to the default "--host" value (for both standard or rootless)
# set "dockerSocket" to the default "--host" *unix socket* value (for both standard or rootless)
uid="$(id -u)"
if [ "$uid" = '0' ]; then
: "${DOCKER_HOST:=unix:///var/run/docker.sock}"
dockerSocket='unix:///var/run/docker.sock'
else
# if we're not root, we must be trying to run rootless
: "${XDG_RUNTIME_DIR:=/run/user/$uid}"
: "${DOCKER_HOST:=unix://$XDG_RUNTIME_DIR/docker.sock}"
dockerSocket="unix://$XDG_RUNTIME_DIR/docker.sock"
fi
export DOCKER_HOST
case "${DOCKER_HOST:-}" in
unix://*)
dockerSocket="$DOCKER_HOST"
;;
esac

# add our default arguments
if [ -n "${DOCKER_TLS_CERTDIR:-}" ] \
Expand All @@ -112,7 +116,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
; then
# generate certs and use TLS if requested/possible (default in 19.03+)
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2376 \
--tlsverify \
--tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \
Expand All @@ -123,7 +127,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
else
# TLS disabled (-e DOCKER_TLS_CERTDIR='') or missing certs
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2375 \
"$@"
DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp"
Expand Down
16 changes: 10 additions & 6 deletions dockerd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ _tls_generate_certs() {
# no arguments passed
# or first arg is `-f` or `--some-option`
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
# set DOCKER_HOST to the default "--host" value (for both standard or rootless)
# set "dockerSocket" to the default "--host" *unix socket* value (for both standard or rootless)
uid="$(id -u)"
if [ "$uid" = '0' ]; then
: "${DOCKER_HOST:=unix:///var/run/docker.sock}"
dockerSocket='unix:///var/run/docker.sock'
else
# if we're not root, we must be trying to run rootless
: "${XDG_RUNTIME_DIR:=/run/user/$uid}"
: "${DOCKER_HOST:=unix://$XDG_RUNTIME_DIR/docker.sock}"
dockerSocket="unix://$XDG_RUNTIME_DIR/docker.sock"
fi
export DOCKER_HOST
case "${DOCKER_HOST:-}" in
unix://*)
dockerSocket="$DOCKER_HOST"
;;
esac

# add our default arguments
if [ -n "${DOCKER_TLS_CERTDIR:-}" ] \
Expand All @@ -112,7 +116,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
; then
# generate certs and use TLS if requested/possible (default in 19.03+)
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2376 \
--tlsverify \
--tlscacert "$DOCKER_TLS_CERTDIR/server/ca.pem" \
Expand All @@ -123,7 +127,7 @@ if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
else
# TLS disabled (-e DOCKER_TLS_CERTDIR='') or missing certs
set -- dockerd \
--host="$DOCKER_HOST" \
--host="$dockerSocket" \
--host=tcp://0.0.0.0:2375 \
"$@"
DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS="${DOCKERD_ROOTLESS_ROOTLESSKIT_FLAGS:-} -p 0.0.0.0:2375:2375/tcp"
Expand Down