I’ve ran into a few problems with docker I’d like to document myself and how to solve them.
Overwriting an entrypoint
If you’ve configured a script as an entrypoint which fails, you can run the docker image with a shell in order to fiddle with the script (instead of continously rebuilding the image):
#--entrypoint (provides a new entry point which is the nominated shell) docker run -i --entrypoint='/bin/bash' -t f5d4a4d6a8eb
Possible errors you face otherwise are these:
/bin/bash: /bin/bash: cannot execute binary file
Weird errors when building the image
I’ve ran into this a few times. Errors like:
Error in PREIN scriptlet in rpm package libvirt-daemon-0.9.11.4-3.fc17.x86_64 or useradd: failure while writing changes to /etc/passwd
If you’ve set SELinux to enforcing, you may want to temporarily disable SELinux for just building the image. Don’t disable SELinux permanently.
Old (base) image
Check if your base image has changed (e.g. docker images) and pull it again (docker pull <image>)