Skip to content
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

Cannot install additional software after upgrade to 1.5 (docker) #1011

Closed
agross opened this issue Nov 1, 2018 · 5 comments
Closed

Cannot install additional software after upgrade to 1.5 (docker) #1011

agross opened this issue Nov 1, 2018 · 5 comments

Comments

@agross
Copy link

agross commented Nov 1, 2018

$ docker run eclipse-mosquitto:latest apk update
ERROR: Unable to lock database: No such file or directory
ERROR: Failed to open apk database: No such file or directory

$ docker run eclipse-mosquitto:1.5 apk update
ERROR: Unable to lock database: No such file or directory
ERROR: Failed to open apk database: No such file or directory

$ docker run eclipse-mosquitto:1.5.3 apk update
ERROR: Unable to lock database: No such file or directory
ERROR: Failed to open apk database: No such file or directory

This has been working before:

$ docker run eclipse-mosquitto:1.4.12 apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
...
@agross agross changed the title Cannot install additional software after upgrade to 1.5 Cannot install additional software after upgrade to 1.5 (docker) Nov 1, 2018
@ralight
Copy link
Contributor

ralight commented Nov 1, 2018

Ok, I guess I've taken reducing the image size down a bit too far. It's a shame, that optimisation saves ~6GB bandwidth per day. I'll sort it out.

@agross
Copy link
Author

agross commented Nov 1, 2018

I have no idea how apk works but I guess it's OK to wipe the cache (and save bandwidth), but keep the data that is required to run an update (package sources?).

@ruimarinho
Copy link

Just remove rm -rf /build /etc/apk /lib/apk and use --no-cache in front of all apk commands so that it doesn't store state.

Another option would be to use multi-stage builds so that only compiled artifacts go into the final image. Much better for code maintainability.

@ralight ralight closed this as completed in 51738d4 Nov 3, 2018
@ralight
Copy link
Contributor

ralight commented Nov 3, 2018

ralight added a commit that referenced this issue Nov 3, 2018
- Don't remove apk database, closes #1011.
- Install mosquitto_passwd, closes #1009.
@ralight
Copy link
Contributor

ralight commented Nov 3, 2018

Multi-stage builds are ok for normal docker images, but not for official images: docker-library/official-images#3383

@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants