我正在使用Docker使用SSL创建特定的nginx容器.
但我不希望我的SSL文件保留在我的版本控制系统中.因此它们是加密的.构建docker容器时,我需要密码来解密文件并测试我的nginx配置.
我正在使用read我的安装脚本中的提示,但Docker只是在提示符处停止:
+ 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
Run Code Online (Sandbox Code Playgroud)
在做某事时是否有某种方法可以获得提示docker build?
谢谢你的帮助 :)
所以我的Dockerfile是这样写的:
# set env vars for linux user
ENV LINUX_USER="kbuser"
...
... # other stuff
...
USER kbuser
Run Code Online (Sandbox Code Playgroud)
但是我想用
USER $LINUX_USER
Run Code Online (Sandbox Code Playgroud)
这样,我只需要在文件的一个位置写入用户名即可。但这是行不通的。
我该如何解决?
谢谢。