在Docker构建期间如何接受许可协议? [英] How to accept license agreement during docker build?

查看:86
本文介绍了在Docker构建期间如何接受许可协议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写可以将yes传递给提示许可协议的Dockerfile?

How to write the Dockerfile that can pass yes to prompting license agreement?

  1. 在Dockerfile目录下, docker build -t"{user}/{tags}".然后构建失败.
  2. docker日志{container id} ,显示消息如下:

  1. under Dockerfile directory, docker build -t "{user}/{tags}" . then build failed.
  2. docker logs {container id}, show message as below:

Preparing to unpack .../ttf-mscorefonts-installer_3.4+nmu1ubuntu2_all.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring ttf-mscorefonts-installer

TrueType core fonts for the Web EULA END-USER LICENSE AGREEMENT FOR 
MICROSOFT SOFTWARE
...
Do you accept the EULA license terms? [yes/no]

推荐答案

在此处通过讨论 issue:[16.04] debconf:由于未安装apt-utils,因此延迟了软件包配置.

Follow by discuession here issue: [16.04] debconf: delaying package configuration, since apt-utils is not installed.

我在Dockerfile中添加了以下三行代码:

I added these three lines of codes in Dockerfile:

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND teletype

RUN apt-get update -y && apt-get install -y --no-install-recommends apt-utils \

最后,我可以构建docker映像了!

Finally I can build the docker image !

这篇关于在Docker构建期间如何接受许可协议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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