build_docker.sh: support including extra files (#17405)

mkctr already has support for including extra files in the built
container image. Wire up a new optional environment variable to thread
that through to mkctr. The operator e2e tests will use this to bake
additional trusted CAs into the test image without significantly
departing from the normal build or deployment process for our
containers.

Updates tailscale/corp#32085

Change-Id: Ica94ed270da13782c4f5524fdc949f9218f79477

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
pull/17377/head
Tom Proctor 2 months ago committed by GitHub
parent 7dfa26778e
commit 16e0abe031
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -38,6 +38,7 @@ TARGET="${TARGET:-${DEFAULT_TARGET}}"
TAGS="${TAGS:-${DEFAULT_TAGS}}" TAGS="${TAGS:-${DEFAULT_TAGS}}"
BASE="${BASE:-${DEFAULT_BASE}}" BASE="${BASE:-${DEFAULT_BASE}}"
PLATFORM="${PLATFORM:-}" # default to all platforms PLATFORM="${PLATFORM:-}" # default to all platforms
FILES="${FILES:-}" # default to no extra files
# OCI annotations that will be added to the image. # OCI annotations that will be added to the image.
# https://github.com/opencontainers/image-spec/blob/main/annotations.md # https://github.com/opencontainers/image-spec/blob/main/annotations.md
ANNOTATIONS="${ANNOTATIONS:-${DEFAULT_ANNOTATIONS}}" ANNOTATIONS="${ANNOTATIONS:-${DEFAULT_ANNOTATIONS}}"
@ -62,6 +63,7 @@ case "$TARGET" in
--push="${PUSH}" \ --push="${PUSH}" \
--target="${PLATFORM}" \ --target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \ --annotations="${ANNOTATIONS}" \
--files="${FILES}" \
/usr/local/bin/containerboot /usr/local/bin/containerboot
;; ;;
k8s-operator) k8s-operator)
@ -80,6 +82,7 @@ case "$TARGET" in
--push="${PUSH}" \ --push="${PUSH}" \
--target="${PLATFORM}" \ --target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \ --annotations="${ANNOTATIONS}" \
--files="${FILES}" \
/usr/local/bin/operator /usr/local/bin/operator
;; ;;
k8s-nameserver) k8s-nameserver)
@ -98,6 +101,7 @@ case "$TARGET" in
--push="${PUSH}" \ --push="${PUSH}" \
--target="${PLATFORM}" \ --target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \ --annotations="${ANNOTATIONS}" \
--files="${FILES}" \
/usr/local/bin/k8s-nameserver /usr/local/bin/k8s-nameserver
;; ;;
tsidp) tsidp)
@ -116,6 +120,7 @@ case "$TARGET" in
--push="${PUSH}" \ --push="${PUSH}" \
--target="${PLATFORM}" \ --target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \ --annotations="${ANNOTATIONS}" \
--files="${FILES}" \
/usr/local/bin/tsidp /usr/local/bin/tsidp
;; ;;
k8s-proxy) k8s-proxy)
@ -134,6 +139,7 @@ case "$TARGET" in
--push="${PUSH}" \ --push="${PUSH}" \
--target="${PLATFORM}" \ --target="${PLATFORM}" \
--annotations="${ANNOTATIONS}" \ --annotations="${ANNOTATIONS}" \
--files="${FILES}" \
/usr/local/bin/k8s-proxy /usr/local/bin/k8s-proxy
;; ;;
*) *)

Loading…
Cancel
Save