Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker secrets in build-time

Is there any feasible possibility to use https://docs.docker.com/engine/swarm/secrets/ inside Dockerfile during build time (NOT docker-compose specific .yml file)?

like image 754
Katve Avatar asked Aug 16 '17 08:08

Katve


People also ask

What are secrets in docker?

About secrets. In terms of Docker Swarm services, a secret is a blob of data, such as a password, SSH private key, SSL certificate, or another piece of data that should not be transmitted over a network or stored unencrypted in a Dockerfile or in your application's source code.

What is the docker BuildKit?

Docker BuildKit is the next generation container image builder, which helps us to make Docker images more efficient, secure, and faster. It's integrated into the Docker release version v18.06. BuildKit is a part of the Moby project which was developed after learning's and failures to make the image build process -

Are docker volumes available during build?

Although there's no functionality in Docker to have volumes at build-time, you can use multi-stage builds, benefit from Docker caching and save time by copying data from other images - be it multi-stage or tagged ones.


1 Answers

Note: Docker secrets are only available to swarm services, not to standalone containers. To use this feature, consider adapting your container to run as a service with a scale of 1.

The answer is no. Secretes are only available in docker swarm. Swarm doesn't build images and it doesn't accept a Dockerfile.

like image 51
yamenk Avatar answered Sep 28 '22 05:09

yamenk