I'm working with some older Docker containers based on Ubuntu 16.04 and 18.04. Occasionally, I rebuild these containers, but I'm running into issues where certain apt packages are no longer available. I've had to compile some packages from source to get around this. What are the best practices for maintaining these containers? Should I save the packages internally? Thanks in advance!
4 Answers
Just so you know, standard support for Ubuntu lasts about 5 years, so keeping these older versions means you might face more issues down the line.
Have you thought about just upgrading your base images? Sticking with EOL systems can pose security risks and might be more of a hassle than it's worth. It could save you more time in the long run.
We actually need to maintain the original container environment for compatibility with production builds.
There isn't a one-size-fits-all answer. One approach is to create your own repository and cache those packages. Alternatively, consider updating your applications to work with newer Ubuntu versions; it's a more future-proof solution.
I'm leaning towards creating an internal cache for the packages. It seems like a good way to handle this.
You could try pinning the version of Ubuntu or the specific packages, but keep in mind that rebuilding the image will attempt to download everything fresh each time. So, it might not fully solve the problem if the packages are missing from the repositories.
True, pinning can help, but I'm facing the same issue with packages disappearing from PPAs.

Yep, I'm aware of that. Just trying to keep things stable for now.