Is there any way to add an invitation during the docker build process?

I use Docker to create a specific nginx container with SSL.

But I do not want my SSL files to be saved on my system with versions as they are. Therefore they are encrypted. When creating a docker container, I need a password to decrypt the files and verify the nginx configuration.

I use read to get a prompt in my install script, but Docker just stops at 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 a way to get a hint when running docker build ?

Thank you for your help:)

+8
shell docker prompt
source share
2 answers

Well, after searching, there is no way to get an invitation during docker build . It was designed to be fully automated.

Then I will take this step during docker run .

Thanks to some larsks in the IRC # docker group it is interesting to read about these issues at https://github.com/GoogleCloudPlatform/kubernetes/issues/2030

Thanks for the help!

+3
source share

Use the expect because it is similar to executing from the command line. COPY expect a script from the docker host and run it.

0
source share

All Articles