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
Our project template uses a .dockerignore that starts with * to ignore ALL files. We then add specific lines prefixed with ! to create exceptions. This way, we do not have issues with too large contexts being send to the engine.
However, this appears to break the type=file build-secrets:
$ podman build --secret=id=MY_SECRET,type=file,src=${SECRETS_FILE} --no-cache -t foo .
Error: failed to parse query parameter 'secrets': "[\"id=MY_SECRET,type=file,src=podman-build-secret1918992619\"]": rename /var/tmp/libpod_builder3673920082/build/podman-build-secret1918992619 /var/tmp/libpod_builder3673920082/podman-build-secret1918992619: no such file or directory
Adding a line !*podman-build-secret* to the .dockerignore seems to be a workaround, but preferably would not want to create exceptions for these names
The problem seems to occur both on mac and windows with type=file based build-secrets. However, more important on mac because on windows the actual docker image build with a file-based secret always results in a different error.
Steps to reproduce the issue
Steps to reproduce the issue
Create a new empty folder
Inside empty folder, create a file .dockerignore with the following contents:
*
Create a new file Dockerfile with the following contents:
FROM alpine
RUN --mount=type=secret,id=MY_SECRET \
ls -la /run/secrets && \
cat /run/secrets/MY_SECRET
Error: failed to parse query parameter 'secrets': "[\"id=MY_SECRET,type=file,src=podman-build-secret1918992619\"]": rename /var/tmp/libpod_builder3673920082/build/podman-build-secret1918992619 /var/tmp/libpod_builder3673920082/podman-build-secret1918992619: no such file or directory
Describe the results you expected
I would expect this command to work without the need for adding !*podman-build-secret* to the .dockerignore file.
The reproduction steps do not result in any error when using docker (though using docker on a linux machine, not on the mac since I do not have the option of running docker on my mac).
podman info output
host:
arch: arm64buildahVersion: 1.38.1cgroupControllers:
- cpuset
- cpu
- io
- memory
- pids
- rdma
- misccgroupManager: systemdcgroupVersion: v2conmon:
package: conmon-2.1.12-3.fc41.aarch64path: /usr/bin/conmonversion: 'conmon version 2.1.12, commit: 'cpuUtilization:
idlePercent: 99.74systemPercent: 0.13userPercent: 0.13cpus: 4databaseBackend: sqlitedistribution:
distribution: fedoravariant: coreosversion: "41"eventLogger: journaldfreeLocks: 2048hostname: localhost.localdomainidMappings:
gidmap: nulluidmap: nullkernel: 6.12.7-200.fc41.aarch64linkmode: dynamiclogDriver: journaldmemFree: 1610174464memTotal: 2042269696networkBackend: netavarknetworkBackendInfo:
backend: netavarkdns:
package: aardvark-dns-1.13.1-1.fc41.aarch64path: /usr/libexec/podman/aardvark-dnsversion: aardvark-dns 1.13.1package: netavark-1.13.1-1.fc41.aarch64path: /usr/libexec/podman/netavarkversion: netavark 1.13.1ociRuntime:
name: crunpackage: crun-1.19.1-1.fc41.aarch64path: /usr/bin/crunversion: |- crun version 1.19.1 commit: 3e32a70c93f5aa5fea69b50256cca7fd4aa23c80 rundir: /run/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJLos: linuxpasta:
executable: /usr/bin/pastapackage: passt-0^20241211.g09478d5-1.fc41.aarch64version: | pasta 0^20241211.g09478d5-1.fc41.aarch64-pasta Copyright Red Hat GNU General Public License, version 2 or later <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.remoteSocket:
exists: truepath: unix:///run/podman/podman.sockrootlessNetworkCmd: pastasecurity:
apparmorEnabled: falsecapabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOTrootless: falseseccompEnabled: trueseccompProfilePath: /usr/share/containers/seccomp.jsonselinuxEnabled: trueserviceIsRemote: trueslirp4netns:
executable: /usr/bin/slirp4netnspackage: slirp4netns-1.3.1-1.fc41.aarch64version: |- slirp4netns version 1.3.1 commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236 libslirp: 4.8.0 SLIRP_CONFIG_VERSION_MAX: 5 libseccomp: 2.5.5swapFree: 0swapTotal: 0uptime: 0h 54m 4.00svariant: v8plugins:
authorization: nulllog:
- k8s-file
- none
- passthrough
- journaldnetwork:
- bridge
- macvlan
- ipvlanvolume:
- localregistries:
search:
- docker.iostore:
configFile: /usr/share/containers/storage.confcontainerStore:
number: 0paused: 0running: 0stopped: 0graphDriverName: overlaygraphOptions:
overlay.imagestore: /usr/lib/containers/storageoverlay.mountopt: nodev,metacopy=ongraphRoot: /var/lib/containers/storagegraphRootAllocated: 106415992832graphRootUsed: 4343402496graphStatus:
Backing Filesystem: xfsNative Overlay Diff: "false"Supports d_type: "true"Supports shifting: "true"Supports volatile: "true"Using metacopy: "true"imageCopyTmpDir: /var/tmpimageStore:
number: 4runRoot: /run/containers/storagetransientStore: falsevolumePath: /var/lib/containers/storage/volumesversion:
APIVersion: 5.3.2Built: 1737504000BuiltTime: Wed Jan 22 01:00:00 2025GitCommit: ""GoVersion: go1.23.4Os: linuxOsArch: linux/arm64Version: 5.3.2
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
On a windows machine the error is the same:
C:\Users\guido\testing_secrets>podman build --secret=id=MY_SECRET,type=file,src=mysecret.txt --no-cache -t foo .
Error: failed to parse query parameter 'secrets': "[\"id=MY_SECRET,type=file,src=podman-build-secret1067707365\"]": rename /var/tmp/libpod_builder3212319988/build/podman-build-secret1067707365 /var/tmp/libpod_builder3212319988/podman-build-secret1067707365: no such file or directory
However, if on the windows machine I update the .dockerignore file to exclude podman-build-secret files, I get a different error:
C:\Users\guido\testing_secrets>podman build --secret=id=MY_SECRET,type=file,src=mysecret.txt --no-cache -t foo .
time="2025-02-13T09:49:18+01:00" level=error msg="1 error occurred:\n\t* archive/tar: write too long\n\n\n"
Error: Post "http://d/v5.3.1/libpod/build?compatvolumes=0&dockerfile=%5B%22Dockerfile%22%5D&forcerm=1&httpproxy=1&identitylabel=1&idmappingoptions=%7B%22HostUIDMapping%22%3Atrue%2C%22HostGIDMapping%22%3Atrue%2C%22UIDMap%22%3A%5B%5D%2C%22GIDMap%22%3A%5B%5D%2C%22AutoUserNs%22%3Afalse%2C%22AutoUserNsOpts%22%3A%7B%22Size%22%3A0%2C%22InitialSize%22%3A0%2C%22PasswdFile%22%3A%22%22%2C%22GroupFile%22%3A%22%22%2C%22AdditionalUIDMappings%22%3Anull%2C%22AdditionalGIDMappings%22%3Anull%7D%7D&isolation=0&jobs=1&layers=1&networkmode=0&nocache=1&nsoptions=%5B%7B%22Name%22%3A%22user%22%2C%22Host%22%3Atrue%2C%22Path%22%3A%22%22%7D%5D&omithistory=0&output=foo&outputformat=application%2Fvnd.oci.image.manifest.v1%2Bjson&pullpolicy=missing&retry=3&retry-delay=2s&rm=1&secrets=%5B%22id%3DMY_SECRET%2Ctype%3Dfile%2Csrc%3Dpodman-build-secret2169833388%22%5D&shmsize=67108864&t=foo": io: read/write on closed pipe
The text was updated successfully, but these errors were encountered:
Issue Description
Our project template uses a
.dockerignore
that starts with*
to ignore ALL files. We then add specific lines prefixed with!
to create exceptions. This way, we do not have issues with too large contexts being send to the engine.However, this appears to break the
type=file
build-secrets:Adding a line
!*podman-build-secret*
to the.dockerignore
seems to be a workaround, but preferably would not want to create exceptions for these namesThe problem seems to occur both on mac and windows with
type=file
based build-secrets. However, more important on mac because on windows the actual docker image build with a file-based secret always results in a different error.Steps to reproduce the issue
Steps to reproduce the issue
.dockerignore
with the following contents:Dockerfile
with the following contents:Describe the results you received
The above steps result in the following error:
Describe the results you expected
I would expect this command to work without the need for adding
!*podman-build-secret*
to the.dockerignore
file.The reproduction steps do not result in any error when using docker (though using docker on a linux machine, not on the mac since I do not have the option of running docker on my mac).
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
On a windows machine the error is the same:
However, if on the windows machine I update the
.dockerignore
file to excludepodman-build-secret
files, I get a different error:The text was updated successfully, but these errors were encountered: