Docker-CODE icon indicating copy to clipboard operation
Docker-CODE copied to clipboard

Do not upgrade packages in container

Open J0WI opened this issue 6 years ago • 4 comments

Avoid RUN apt-get upgrade and dist-upgrade, as many of the “essential” packages from the parent images cannot upgrade inside an unprivileged container. If a package contained in the parent image is out-of-date, contact its maintainers. If you know there is a particular package, foo, that needs to be updated, use apt-get install -y foo to update automatically.

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run https://github.com/CollaboraOnline/Docker-CODE/blob/f5cddf024f711c3126e8b1a03701822533ea71c7/scripts/install-libreoffice.sh#L4

Also install-libreoffice.sh should be replaced by RUN statements.

J0WI avatar Jan 08 '19 20:01 J0WI

I tried to fix this, but run into issues with the unusual apt repo structure:

apt-get update
...
Err:5 https://collaboraoffice.com/repos/CollaboraOnline/CODE ./ Packages
...
W: The repository 'https://collaboraoffice.com/repos/CollaboraOnline/CODE ./ Release' does not have a Release file.
E: Failed to fetch https://collaboraoffice.com/repos/CollaboraOnline/CODE/./Packages  
E: Some index files failed to download. They have been ignored, or old ones used instead.

J0WI avatar Jan 08 '19 20:01 J0WI

Avoid RUN apt-get upgrade

OK, I tend to agree. Maybe we don't need this.

Also install-libreoffice.sh should be replaced by RUN statements.

I think the rational was that RUn statements introduced many layers and had a negative effect on image size. What's wrong with install-libreoffice.sh?

timar avatar Jan 08 '19 20:01 timar

What's wrong with install-libreoffice.sh?

  • the build process is less transparent with a single script
  • more layers would also use (more) build cache
  • layers can be shared across different images and versions
  • layers can be downloaded in parallel

J0WI avatar Jan 08 '19 20:01 J0WI

W: The repository 'https://collaboraoffice.com/repos/CollaboraOnline/CODE ./ Release' does not have a Release file.

Hmm, I don't know what's wrong. If you go to https://collaboraoffice.com/repos/CollaboraOnline/CODE you can see that there is a Release file.

timar avatar Jan 08 '19 20:01 timar