My app has already been deployed. I later discovered I needed additional packages installed on my server, namely poppler-utils and ffmpeg. I updated my dockerfile to reflect this and redeployed but these packages were not installed and I have to install them manually after every deployment.
The strange thing is, that other updates seem to have been pushed, albeit for different commands.
I know there is a way to do this, and my understanding is that the docs have been updated to reflect this, but I cannot seem to find the definitive answer to how this is done.
So, for the record, would someone please help with a list of steps.
It would help if you posted your Dockerfile. It likely contains a series of FROM statements, each of which defines a separate build step. The step that is deployed is the last one, so either:
you need to install these packages in that step
that FROM step defines a previous step as its base, and you installed these packages in that step
(less frequently used) that step contains a COPY statement that copies that package from elsewhere.
I just asked ChatGPT and this is the answer it gave me:
In a multistage Dockerfile, anything installed in an intermediate stage (build, in this case) won’t be available in the final image (base). Only files or layers explicitly copied from an intermediate stage make it to the final stage.
In your Dockerfile, poppler-utils and ffmpeg are indeed installed in the build stage but not transferred to the final base stage, where the app actually runs. So, they aren’t available when the container is running. The solution is to ensure they’re installed in the final stage where they’re needed.
To keep everything organized and install these only where necessary, here’s the adjusted version:
# Install runtime dependencies in the base stage
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y poppler-utils ffmpeg && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
Or if you prefer them to be universally available, add them to base:
# Install runtime dependencies in the base stage
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y poppler-utils ffmpeg && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
I’ll test this and get back to you all. Meanwhile, I would really appreciate it if someone with “human” intelligence could add to the conversation. Perhaps we can help others in the meantime.
Thank you very much @rubys for your support. I really appreciate it. I hope you understand I mean no disrespect as my “dry” words may sound. You’ve helped me save numerous hours of work.