New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix qemu binfmt image is pulled during instance startup #1231
Fix qemu binfmt image is pulled during instance startup #1231
Conversation
It should have been pulled when the AMI is built.
…we source the lib file
When you pull an image from a registry and specify both a tag and a digest, docker does not seem to tag it locally. This leaves the image unable to be run if both the tag and the digest are specified to `docker run`. But it will run if only by the digest is specified.
sudo mkdir -p /usr/local/lib | ||
echo "QEMU_BINFMT_TAG=\"$QEMU_BINFMT_TAG\"" | sudo tee -a /usr/local/lib/bk-configure-docker.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When images are pulled with a tag and digest, docker does not seem to keep the tag. Try it with
$ docker pull alpine:3.18.4@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine <none> 8ca4688f4f35 4 days ago 7.33MB
I don't think it affects docker run
though 🤷♂️.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work 🎉
The intention was always for it to be pulled when the AMI is built, and just run when then instance is started, but it turns out the garbage collector was running before the docker setup script, so the image was being pulled on every instance start.
This PR fixes this by only enabling the timers after docker has been configured and the qemu binfmt image has run.
I've also added more comments around the mechanism by which the digest of the qemu binfmt image is passed from the packer build scripts to the startup script, as it was the source of some confusion. As well as more logging in general.
Closes: #1229