Skip to content

Commit b7727ae

Browse files
authored
Merge branch 'main' into nt/gracefully-terminate-bk-agents
2 parents 9f470cd + 0071d9a commit b7727ae

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

packer/linux/conf/bin/bk-configure-docker.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ if [[ "${DOCKER_NETWORKING_PROTOCOL}" == "ipv4" ]]; then
5757
# This is the default
5858
cat <<<"$(
5959
jq \
60-
'."default-address-pools"=[{"base":"172.17.0.0/12","size":20},{"base":"192.168.0.0/16","size":24}]' \
60+
--arg pool1 "${DOCKER_IPV4_ADDRESS_POOL_1:-172.17.0.0/12}" \
61+
--arg pool2 "${DOCKER_IPV4_ADDRESS_POOL_2:-192.168.0.0/16}" \
62+
'."default-address-pools"=[{"base":$pool1,"size":20},{"base":$pool2,"size":24}]' \
6163
/etc/docker/daemon.json
6264
)" >/etc/docker/daemon.json
6365
elif [[ "${DOCKER_NETWORKING_PROTOCOL}" == "dualstack" ]]; then
@@ -66,7 +68,10 @@ elif [[ "${DOCKER_NETWORKING_PROTOCOL}" == "dualstack" ]]; then
6668
DOCKER_EXPERIMENTAL=true
6769
cat <<<"$(
6870
jq \
69-
'.ipv6=true | ."fixed-cidr-v6"="2001:db8:1::/64" | .ip6tables=true | ."default-address-pools"=[{"base":"172.17.0.0/12","size":20},{"base":"192.168.0.0/16","size":24},{"base":"2001:db8:2::/104","size":112}]' \
71+
--arg pool1 "${DOCKER_IPV4_ADDRESS_POOL_1:-172.17.0.0/12}" \
72+
--arg pool2 "${DOCKER_IPV4_ADDRESS_POOL_2:-192.168.0.0/16}" \
73+
--arg pool6 "${DOCKER_IPV6_ADDRESS_POOL:-2001:db8:2::/104}" \
74+
'.ipv6=true | ."fixed-cidr-v6"="2001:db8:1::/64" | .ip6tables=true | ."default-address-pools"=[{"base":$pool1,"size":20},{"base":$pool2,"size":24},{"base":$pool6,"size":112}]' \
7075
/etc/docker/daemon.json
7176
)" >/etc/docker/daemon.json
7277
else

templates/aws-stack.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,21 @@ Parameters:
606606
- "dualstack"
607607
Default: "ipv4"
608608

609+
DockerIPv4AddressPool1:
610+
Type: String
611+
Description: Primary IPv4 CIDR block for Docker default address pools. Must not conflict with host network or VPC CIDR. Only applies to Linux instances, not Windows.
612+
Default: "172.17.0.0/12"
613+
614+
DockerIPv4AddressPool2:
615+
Type: String
616+
Description: Secondary IPv4 CIDR block for Docker default address pools. Only applies to Linux instances, not Windows.
617+
Default: "192.168.0.0/16"
618+
619+
DockerIPv6AddressPool:
620+
Type: String
621+
Description: IPv6 CIDR block for Docker default address pools in dualstack mode. Only applies to Linux instances, not Windows.
622+
Default: "2001:db8:2::/104"
623+
609624
EnableSecretsPlugin:
610625
Type: String
611626
Description: Enables s3-secrets plugin for all pipelines
@@ -1593,6 +1608,9 @@ Resources:
15931608
DOCKER_USERNS_REMAP=${EnableDockerUserNamespaceRemap} \
15941609
DOCKER_EXPERIMENTAL=${EnableDockerExperimental} \
15951610
DOCKER_NETWORKING_PROTOCOL=${DockerNetworkingProtocol} \
1611+
DOCKER_IPV4_ADDRESS_POOL_1=${DockerIPv4AddressPool1} \
1612+
DOCKER_IPV4_ADDRESS_POOL_2=${DockerIPv4AddressPool2} \
1613+
DOCKER_IPV6_ADDRESS_POOL=${DockerIPv6AddressPool} \
15961614
BUILDKITE_ENABLE_INSTANCE_STORAGE="${EnableInstanceStorage}" \
15971615
/usr/local/bin/bk-configure-docker.sh
15981616
--==BOUNDARY==

0 commit comments

Comments
 (0)