I'm using Docker to create a specific nginx container with SSL.
But I don't want my SSL files to be kept in my versionning system as is. Therefore they are encrypted. When building a docker container, I need the password to decrypt the files and test my nginx configuration.
I'm using read
to get a prompt in my install script but Docker simply stops on the prompt:
+ echo 'Please enter the password for the SSL certificates: '
+ read -s SSL_PASSWORD
INFO[0008] The command [/bin/sh -c /build/setup.sh && /build/cleanup.sh] returned a non-zero code: 1
Is there some way to get a prompt when doing a docker build
?
Thanks for your help :)
You can now drop into your Docker image and start interactively running commands! You can keep running these steps, commenting out your Dockerfile, dropping into a shell, and figuring out problematic commands, until your Docker images builds perfectly.
The ADD command is used to copy files/directories into a Docker image. It can copy data in three ways: Copy files from the local storage to a destination in the Docker image. Copy a tarball from the local storage and extract it automatically inside a destination in the Docker image.
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.
By default the docker build command will look for a Dockerfile at the root of the build context. The -f , --file , option lets you specify the path to an alternative file to use instead. This is useful in cases where the same set of files are used for multiple builds.
Well, after searching around, there's not way to have a prompt during a docker build
. It has been designed to be fully automated.
I'll do this step during the docker run
then.
Thanks to a certain larsks
on the IRC #docker group, there's an interesting read about these issues at https://github.com/GoogleCloudPlatform/kubernetes/issues/2030
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With