有没有办法在docker构建过程中添加提示? [英] Is there a way to add a prompt during the docker build process?

查看:83
本文介绍了有没有办法在docker构建过程中添加提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Docker创建一个带有SSL的特定nginx容器。



但是我不希望我的SSL文件原样保留在我的版本控制系统中。因此,它们是加密的。在构建docker容器时,我需要密码来解密文件并测试我的nginx配置。



我正在使用 read 在我的安装脚本中得到提示,但Docker只是在提示上停止:

  + echo'请输入密码对于SSL证书:'
+读-s SSL_PASSWORD
INFO [0008]命令[/ bin / sh -c /build/setup.sh& /build/cleanup.sh]返回了非零代码:1

是否有某种获取方法 docker build 吗?



感谢您的帮助:)

解决方案

好吧,在四处搜索之后,在 docker构建期间没有提示的方法。



然后我将在 docker run 期间执行此步骤。 / p>

由于IRC #docker组中的某些 larsks ,在 https://github.com/GoogleCloudPlatform/kubernetes/issues/2030


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 :)

解决方案

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

这篇关于有没有办法在docker构建过程中添加提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆