docker映像的大小非常大

问题描述 投票:0回答:1

我已经在dockerfile中安装了Apache-Airflow。但是图像2.03 GB的大小非常大。我正在使用ubuntu:18.04。我想我正在安装一些不必要的依赖项。

有人可以帮我缩小图像吗?

dockerfile

FROM ubuntu:18.04

ENV SLUGIFY_USES_TEXT_UNIDECODE=yes
RUN apt-get update && apt-get install -y \
    software-properties-common
RUN apt-get install -y curl \
    git \
    python3.6 \
    libpython3.6 \
    python3-pip \
    python-dev \
    python3-dev \
    build-essential \
    libssl-dev \
    libxml2-dev \
    libxslt1-dev \
    zlib1g-dev \
    libkrb5-dev \
    make gcc \
    libsasl2-dev \
    libmysqlclient-dev
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
RUN rm /usr/bin/python3 && ln -s python3.6 /usr/bin/python3
RUN pip3 install setuptools -U
RUN pip3 install werkzeug==0.16.0
RUN export AIRFLOW_HOME=~/airflow
RUN pip3 install apache-airflow[all]==1.10.8
RUN pip3 install 'apache-airflow[celery]'

EXPOSE 8080
RUN airflow initdb
CMD ["airflow", "webserver"]

python docker ubuntu dockerfile docker-image
1个回答
0
投票

Ubuntu基本映像很大。

如果您确实需要Ubuntu,则可以使用Alpine映像。

© www.soinside.com 2019 - 2024. All rights reserved.