Par*_*eog 5 postgresql docker dockerfile
我有以下 docker 文件,我正在使用该命令docker build -t demo:v1 .来构建映像。
FROM ubuntu:18.04
WORKDIR /app
RUN apt update \
&& apt -y upgrade \
&& apt install -y python3 \
&& apt install -y python3-pip \
&& apt install -y poppler-utils \
&& apt install -y libsm6 libxext6 libxrender-dev
RUN apt install -y postgresql
COPY requirements.txt /app/requirements.txt
RUN pip3 install -r requirements.txt
COPY . /app
CMD gunicorn -t 300 --workers 5 --bind 0.0.0.0:8080 wsgi
Run Code Online (Sandbox Code Playgroud)
当我使用它构建图像时,在安装 postgresql 时,它需要输入并像这样停止构建过程
.
.
.
.
Setting up libpopt0:amd64 (1.16-11) ...
Setting up tzdata (2019c-0ubuntu0.18.04) ...
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 tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Run Code Online (Sandbox Code Playgroud)
那么,如何在我的图像中设置 postgresql,以便在不期望此输入的情况下进行构建?此外,令人惊讶的是,即使我输入了我的选项,也没有进一步发生,并且过程会卡住。
将此添加到您的 Dockerfile
ARG DEBIAN_FRONTEND=noninteractive
Run Code Online (Sandbox Code Playgroud)
安装前 postgresql
我认为您可能想要使用apt-get而不是apt避免此警告:
警告:apt 没有稳定的 CLI 界面。在脚本中谨慎使用。
| 归档时间: |
|
| 查看次数: |
1098 次 |
| 最近记录: |