I think my issue is related to this closed issue.
I'm on windows and trying to mount a secret into an image I'm building but it doesn't work.
I tried building the secret in a compose file and using podman compose with the 1.2.0 version but it doesn't work either.
I think the problem comes from how secrets are mounted in podman.
Steps to reproduce the issue
I first created a secret named rsa_private_key using podman secret create rsa_private_key ./rsa_private_key.txt which gave me the following output: 4bf444f9a65ec70ce89c41fd9.
Running podman secret ls shows the secret does exist:
ID NAME DRIVER CREATED UPDATED
4bf444f9a65ec70ce89c41fd9 rsa_private_key file 16 minutes ago 16 minutes ago
I tried running this simple Containerfile:
FROM ubuntu:23.04
RUN --mount=type=secret,id=rsa_private_key cat /run/secrets/rsa_private_key
Then I simply run podman build -t testimage ..
Describe the results you received
And I keep getting this output when running podman build -t testimage .:
STEP 1/2: FROM ubuntu:23.04
STEP 2/2: RUN --mount=type=secret,id=rsa_private_key cat /run/secrets/rsa_private_key
cat: /run/secrets/rsa_private_key: No such file or directory
Error: building at STEP "RUN --mount=type=secret,id=rsa_private_key cat /run/secrets/rsa_private_key": while running runtime: exit status 1
Describe the results you expected
I expected the image to be created with no issue but it seems like mounting secrets on windows does not work.
Issue Description
I think my issue is related to this closed issue. I'm on windows and trying to mount a secret into an image I'm building but it doesn't work. I tried building the secret in a compose file and using podman compose with the 1.2.0 version but it doesn't work either. I think the problem comes from how secrets are mounted in podman.
Steps to reproduce the issue
I first created a secret named
rsa_private_key
usingpodman secret create rsa_private_key ./rsa_private_key.txt
which gave me the following output:4bf444f9a65ec70ce89c41fd9
.Running
podman secret ls
shows the secret does exist:I tried running this simple Containerfile:
Then I simply run
podman build -t testimage .
.Describe the results you received
And I keep getting this output when running
podman build -t testimage .
:Describe the results you expected
I expected the image to be created with no issue but it seems like mounting secrets on windows does not work.
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
I'm running it locally.
Additional information
I ran the
podman version
command and this is the output I'm getting: