You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Dockerfile in a git repository with a line like this:
RUN --mount=type=bind,source=.,target=/tmp/source git clone --single-branch file:///tmp/source code_repo
I tried to use podman build on this Dockerfile and found that I needed to add ,Z onto the end of the mount options to avoid an SELinux permission error (I was testing in Fedora). With that change, the image can be built. However, docker build does not work with the ,Z option. Is there any subtle change that could let this step work with both podman and docker?
This step is just getting the code into the image. It could be replaced with a COPY but the current syntax is a little nicer for development because it avoids copying in any temporary files in the repo. A separate script could create a git bundle and copy that in but it is nice that the current Dockerfile does not require set up steps before building.
By the way, I had to make two other small changes to switch from docker to podman. I don't know if they are worth capturing anywhere else but I will mention them here:
I had been using docker build --secret=id=secret.txt which apparently is equivalent to docker build --secret=id=secret.txt,src=secret.txt but podman only supports the latter syntax.
My file originally had RUN --mount=source=.,target=/tmp/source,type=bind which worked fine with docker, but podman/buildah requires that type=bind be the first --mount option.
These were easy to address but are little papercuts for switching from docker to podman/buildah.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a Dockerfile in a git repository with a line like this:
I tried to use
podman build
on this Dockerfile and found that I needed to add,Z
onto the end of the mount options to avoid an SELinux permission error (I was testing in Fedora). With that change, the image can be built. However,docker build
does not work with the,Z
option. Is there any subtle change that could let this step work with bothpodman
anddocker
?This step is just getting the code into the image. It could be replaced with a
COPY
but the current syntax is a little nicer for development because it avoids copying in any temporary files in the repo. A separate script could create a git bundle and copy that in but it is nice that the current Dockerfile does not require set up steps before building.By the way, I had to make two other small changes to switch from docker to podman. I don't know if they are worth capturing anywhere else but I will mention them here:
docker build --secret=id=secret.txt
which apparently is equivalent todocker build --secret=id=secret.txt,src=secret.txt
but podman only supports the latter syntax.RUN --mount=source=.,target=/tmp/source,type=bind
which worked fine with docker, but podman/buildah requires thattype=bind
be the first--mount
option.These were easy to address but are little papercuts for switching from docker to podman/buildah.
Beta Was this translation helpful? Give feedback.
All reactions