-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/run/secrets/<secret-id> file not present when secrets are read from env variables #2302
Comments
Do you have |
Yes, like I mentioned in the 1st comment, its value is set as 'abcd' echo $RHS_USERNAME |
Just to be sure, because I recall Red Hat also using RUN --mount=type=secret,id=username,target=/foobar cat /foobar |
|
I tried that but its also not working.
|
Can you please try once with "registry.access.redhat.com/rhel7/rhel:latest" as base image. I tried listing the secrets using ls -l /run/secrets but seems no secrets are present
|
Could you also update the top description to include Or you can install |
Yes the docker version is 20.10.7. Pasting output of both commands below
|
Thanks for adding that info. Nope, no ideas then. I tried your example earlier, also with the rhel base image, but wasn't able to reproduce the problem 🤔 |
Make sure the value shows up on running |
Okay, where should I be setting the env variable? Right now, I am setting it in "/home//.bashrc" file and then I did run source "/home/shaaga/.bashrc". |
Yes it shows up in |
Ah! Your reproduction steps didn't show that In that case, use |
Yes that worked. Thank you so much. |
Great! Let me close this ticket, as (from the above) it looks like there's no bug. Contributions to improve the documentation (in case it's useful to mention) welcome though |
Dockerfile content:
Docker build command:
RHS_USERNAME variable is set:
Output of build command:
When I store the env variable value in a text file (mysecret.txt) and modify the docker build command as below, everything works fine.
What am I missing here? Are the secrets not stored in /run/secrets directory when created from an env variable?
Suggested assignee
@tonistiigi
shaaga@osimagecreationvm:/datadrive/Image-builder/scripts$ sudo docker version
Client: Docker Engine - Community
Version: 20.10.7
API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:40 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:48 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0
shaaga@osimagecreationvm:/datadrive/Image-builder/scripts$ sudo docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.7
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.4.0-1051-azure
Operating System: Ubuntu 18.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.776GiB
Name: osimagecreationvm
ID: 35O2:2VPC:Z4HC:GQVU:QYC6:XRTW:O4TF:HPRU:ZTA2:ZXZC:KA5S:TO5V
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
The text was updated successfully, but these errors were encountered: