Skip to content
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

Secret does not get mounted in Dockerfile at build time #9248

Closed
3rd3 opened this issue Mar 8, 2022 · 1 comment
Closed

Secret does not get mounted in Dockerfile at build time #9248

3rd3 opened this issue Mar 8, 2022 · 1 comment

Comments

@3rd3
Copy link

3rd3 commented Mar 8, 2022

Description

I am trying to mount a file as a secret, however I am unable to access it.

Steps to reproduce the issue:

Dockerfile:

FROM alpine
RUN --mount=type=secret,id=mysecret,dst=/test cat /test 

docker-compose.yml:

services:
  test:
    build: .
    secrets:
      - mysecret
secrets:
  mysecret:
    file: mysecret

To run:

echo "ok" > mysecret
DOCKER_BUILDKIT=1 docker-compose up -d

Describe the results you received:

The build process prints an error: /test: No such a file or directory

Describe the results you expected:

The build process should print ok.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

Output of docker info:

Client:                                                                              
 Context:    default                                                                 
 Debug Mode: false                                                                   
                                                                                     
Server:                                                                              
 Containers: 25                                                                      
  Running: 0                                                                         
  Paused: 0                                                                          
  Stopped: 25                                                                        
 Images: 36                                                                          
 Server Version: 20.10.11                                                            
 Storage Driver: overlay2                                                            
  Backing Filesystem: extfs                                                          
  Supports d_type: true                                                              
  Native Overlay Diff: true                                                          
  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: 7b11cfaabd73bb80907dd23182b9347b4245eb5d                        
 runc version: v1.0.3-0-gf46b6ba                                                     
 init version: de40ad0                                                               
 Security Options:                                                                   
  apparmor                                                                           
  seccomp                                                                            
   Profile: default                                                                  
 Kernel Version: 5.10.83-5.ph4-esx                                                   
 Operating System: VMware Photon OS/Linux                                            
 OSType: linux                                                                       
 Architecture: x86_64                                                                
 CPUs: 2                                                                             
 Total Memory: 15.65GiB                                                              
 Name: photon-vm                                                                     
 ID: NY4K:3ABX:F3R6:KZIJ:DBYU:PRJF:3YPL:5VST:MPOV:YOPK:PSB7:TUYV                     
 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                                                         
 Product License: Community Engine                                                   
 Default Address Pools:                                                              
   Base: 10.90.0.0/16, Size: 24                                                      
@3rd3 3rd3 changed the title Secrets does not get mounted in Dockerfile Secret does not get mounted in Dockerfile Mar 8, 2022
@3rd3 3rd3 changed the title Secret does not get mounted in Dockerfile Secret does not get mounted in Dockerfile at build time Mar 8, 2022
@3rd3
Copy link
Author

3rd3 commented Mar 8, 2022

Duplicate of #6358.

@3rd3 3rd3 closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant