以下Dockerfile为何build不了?问题出在哪里?

 夕阳的春天8989_110 发布于 2022-10-25 17:23

FROM ubuntu
LABEL Description="test" Vender="test" Version="1.0"
RUN apt-get update && apt-get install -y git gcc g++ tmux apt-utils mysql-client mysql-server

docker build -t test/test .

卡在下面这里了,等多久没没用,为何会这样呢?
上面Dockerfile问题出在哪里呢?

Selecting previously unselected package psmisc.
Preparing to unpack .../psmisc_22.21-2.1build1_amd64.deb ...
Unpacking psmisc (22.21-2.1build1) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up mysql-common (5.7.16-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 10999 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.16-0ubuntu0.16.04.1_amd64.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 mysql-server-5.7
----------------------------

While not mandatory, it is highly recommended that you set a password for the
MySQL administrative "root" user.

If this field is left blank, the password will not be changed.

New password for the MySQL "root" user: 
2 个回答
  • build的时候你不能交互了。。如果你需要mysql你可以直接下载mysql的镜像,如果你还需要加东西,你可以先用-it开一个容器,然后安装,退出容器commit那个容器,然后做出镜像即可

    2022-10-26 23:38 回答
  • 这个需要交互的,它一直在等待输入密码,所以就卡住了。
    你可以参考一下这篇文章: http://blog.csdn.net/fickyou/...

    2022-10-26 23:38 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有