我在 VSCode 上使用 Remote-Containers 扩展来直接在我正在运行的容器上工作。我的容器的项目层次结构如下所示:
angular_container
/usr/
src/
app/
frontend/
my-source-files
Run Code Online (Sandbox Code Playgroud)
我右键单击我的容器并选择“附加 Visual Studio Code”选项。默认情况下,这会打开我的容器上不存在的 /usr/src/app/src/ 目录。有没有办法更改此设置,以便 VSCode 打开 /usr/src/app/ 目录?远程 - 容器扩展设置没有指定类似的内容。
我正在尝试按照 Certbot 网站上的步骤将 Certbot 安装到我的 Nginx 容器中: https: //certbot.eff.org/lets-encrypt/pip-nginx
Dockerfile:
FROM nginx:1.17.1
# install wget
RUN apt-get update
RUN apt-get install wget -y
# install certbot
RUN wget https://dl.eff.org/certbot-auto
RUN mv certbot-auto /usr/local/bin/certbot-auto
RUN chown root /usr/local/bin/certbot-auto
RUN chmod 0755 /usr/local/bin/certbot-auto
# get certificate
RUN /usr/local/bin/certbot-auto --nginx -y
# setup automatic renewal
...
Run Code Online (Sandbox Code Playgroud)
我使用 docker-compose 构建图像
$ docker-compose build
Run Code Online (Sandbox Code Playgroud)
构建在“# getcertificate”步骤中止
...因为我无法在构建过程中输入“y”?
有没有办法可以在构建过程中输入“y”?我已尝试传递 -y 标志(如 Dockerfile 中所示),但构建仍然中止。