Skip to content

Commit 3927d72

Browse files
committed
always use a fresh docker config for each step
This improves job isolation, preventing jobs from relying on authentication configured in other jobs. This is based on PR #678, but we've removed the stack parameter because the v5.0.0 release is pending and we're comfortable making a small breaking change.
1 parent c4d93f2 commit 3927d72

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

packer/linux/conf/bin/bk-install-elastic-stack.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ PLUGINS_ENABLED=()
4949
[[ $ECR_PLUGIN_ENABLED == "true" ]] && PLUGINS_ENABLED+=("ecr")
5050
[[ $DOCKER_LOGIN_PLUGIN_ENABLED == "true" ]] && PLUGINS_ENABLED+=("docker-login")
5151

52-
[[ $ISOLATE_DOCKER_CONFIG == "true" ]] && DOCKER_CONFIG="export DOCKER_CONFIG=\$(mktemp -d)"
53-
5452
# cfn-env is sourced by the environment hook in builds
5553
cat << EOF > /var/lib/buildkite-agent/cfn-env
5654
export DOCKER_VERSION=$DOCKER_VERSION
@@ -62,7 +60,7 @@ export AWS_DEFAULT_REGION=$AWS_REGION
6260
export AWS_REGION=$AWS_REGION
6361
export PLUGINS_ENABLED="${PLUGINS_ENABLED[*]-}"
6462
export BUILDKITE_ECR_POLICY=${BUILDKITE_ECR_POLICY:-none}
65-
${DOCKER_CONFIG:-""}
63+
export DOCKER_CONFIG=\$(mktemp -d)
6664
EOF
6765

6866
if [[ "${BUILDKITE_AGENT_RELEASE}" == "edge" ]] ; then

templates/aws-stack.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ Metadata:
7474
Parameters:
7575
- EnableDockerUserNamespaceRemap
7676
- EnableDockerExperimental
77-
- IsolateDockerConfig
7877

7978
- Label:
8079
default: Docker Registry Configuration
@@ -356,14 +355,6 @@ Parameters:
356355
- "false"
357356
Default: "false"
358357

359-
IsolateDockerConfig:
360-
Type: String
361-
Description: Isolates Docker Configuration per step
362-
AllowedValues:
363-
- "true"
364-
- "false"
365-
Default: "false"
366-
367358
EnableCostAllocationTags:
368359
Type: String
369360
Description: Enables AWS Cost Allocation tags for all resources in the stack. See https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html
@@ -873,7 +864,6 @@ Resources:
873864
$Env:ECR_PLUGIN_ENABLED="${EnableECRPlugin}"
874865
$Env:DOCKER_LOGIN_PLUGIN_ENABLED="${EnableDockerLoginPlugin}"
875866
$Env:AWS_REGION="${AWS::Region}"
876-
$Env:ISOLATE_DOCKER_CONFIG="${IsolateDockerConfig}"
877867
powershell -file C:\buildkite-agent\bin\bk-install-elastic-stack.ps1 >> C:\buildkite-agent\elastic-stack.log
878868
</powershell>
879869
- {

0 commit comments

Comments
 (0)