Dockerfile中的交互式命令

编程入门 行业动态 更新时间:2024-10-28 18:25:41
本文介绍了Dockerfile中的交互式命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用 docker build 命令和相应的 Dockerfile 自动创建开发Docker映像。我需要在 RUN 命令中运行的脚本之一希望用户单击以阅读其许可协议。因此有两个问题:

I'm trying to automate a creation of a development Docker image using docker build command with appropriate Dockerfile. One of the scripts that I need to run in a RUN command wants the user to click through and read their license agreement. Thus there are two questions:

  • 所有 RUN 命令的输出在哪里在 Dockerfile 中?
  • 与上述命令交互的解决方案是什么?现在, docker build 命令被卡住,要求用户无限循环输入。
  • Where is the output of all the RUN commands in a Dockerfile?
  • What solution is possible to interact with the aforementioned command? Right now the docker build command just gets stuck asking user for input in an infinite loop.
  • 推荐答案

    在构建过程中,将在终端中显示 RUN 命令的输出。 Docker的构建过程是完全非交互的,因此您必须找到一种自动接受条款的方式(几乎每个软件都允许这样做,请考虑 apt-get install -y ...

    The output of RUN commands is shown in your terminal during the build. The Docker build process is completely non-interactive, so you must find some way of either auto-accepting the terms (almost every piece of software allows this, think apt-get install -y...) or using some shell wizardry to echo the acceptance back to the process or whatever (Expect maybe?).

    更多推荐

    Dockerfile中的交互式命令

    本文发布于:2023-10-18 18:26:47,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1505022.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:命令   Dockerfile

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!