Podman missing commands in later layers

42 Views Asked by At

I have a strange problem when using a Dockerfile with podman. I have a big Dockerfile that worked with docker. Now I want to use podman but fail to build the image. The build fails because podman complains that it cannot find a command installed in one the previous layers. Example would be pip. I install pip in one of the first layers:

RUN apt-get update && apt-get install -y python3-pip

Then I have 8 other layers (RUN, ARG, WORKDIR, ...) and then another layer where I want to use pip:

RUN python3 -m pip install alembic

But the build then fails in this layer complaining that it cannot find pip and I can't see why.

If I again install pip in this layer it works:

RUN apt-get update && apt-get install -y python3-pip && python3 -m pip install alembic

But this should not be the case and is not the case with docker. Any ideas what I am doing wrong?

The build command that I am using is a simple podman build --tag=test .

0

There are 0 best solutions below