Skip to content

Commit

Permalink
Customize docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbaker1 committed Oct 10, 2024
1 parent dc95aa1 commit 6b129e1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions templates/al2/provisioners/cache-pause-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ set -o pipefail
AWS_DOMAIN=$(imds 'latest/meta-data/services/domain')
ECR_URI="$(/etc/eks/get-ecr-uri.sh ${AWS_REGION} ${AWS_DOMAIN})"

TAG="localhost/kubernetes/pause:0.1.0"
EXPORT_PATH=/etc/eks/pause.tar
PAUSE_CONTAINER_IMAGE="${ECR_URI}/eks/pause:3.5"

sudo systemctl start containerd
cache-pause-container -i "${ECR_URI}/eks/pause:3.5" -t ${TAG} -e ${EXPORT_PATH}
cache-pause-container -i ${PAUSE_CONTAINER_IMAGE}
sudo systemctl stop containerd

# we also need to import the image into docker, which is still default on 1.23
# and supportted below 1.25.
# NOTE: there was some difficulty importing the same image exported by ctr, so
# this part follows separately
if vercmp ${KUBERNETES_VERSION} lt "1.25"; then
sudo systemctl start docker
sudo docker image import ${EXPORT_PATH} ${TAG}
aws ecr get-login-password | sudo docker login --username AWS --password-stdin ${ECR_URI}
sudo docker pull ${PAUSE_CONTAINER_IMAGE}
sudo docker image tag ${PAUSE_CONTAINER_IMAGE} "localhost/kubernetes/pause:0.1.0"
sudo systemctl stop docker
fi

0 comments on commit 6b129e1

Please sign in to comment.