9e34003136
To clean up the image build procedure, and let setuptools/pip[3] implicitly install Python dependencies. Also use ipaddress package instead of ipaddr.
51 lines
1.1 KiB
Django/Jinja
51 lines
1.1 KiB
Django/Jinja
FROM docker-base
|
|
|
|
## Make apt-get non-interactive
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update
|
|
|
|
# Dependencies for sonic-cfggen
|
|
RUN apt-get install -y build-essential python-pip python-dev
|
|
|
|
RUN pip install --upgrade pip
|
|
|
|
RUN apt-get purge -y python-pip
|
|
|
|
{% if docker_config_engine_debs.strip() %}
|
|
COPY \
|
|
{% for deb in docker_config_engine_debs.split(' ') -%}
|
|
debs/{{ deb }}{{' '}}
|
|
{%- endfor -%}
|
|
debs/
|
|
{%- endif -%}
|
|
|
|
{% if docker_config_engine_debs.strip() %}
|
|
RUN dpkg -i \
|
|
{% for deb in docker_config_engine_debs.split(' ') -%}
|
|
debs/{{ deb }}{{' '}}
|
|
{%- endfor %}
|
|
{%- endif -%}
|
|
|
|
{% if docker_config_engine_whls.strip() %}
|
|
COPY \
|
|
{% for whl in docker_config_engine_whls.split(' ') -%}
|
|
python-wheels/{{ whl }}{{' '}}
|
|
{%- endfor -%}
|
|
python-wheels/
|
|
{%- endif -%}
|
|
|
|
{% if docker_config_engine_whls.strip() %}
|
|
RUN pip install \
|
|
{% for whl in docker_config_engine_whls.split(' ') -%}
|
|
python-wheels/{{ whl }}{{' '}}
|
|
{%- endfor %}
|
|
{%- endif -%}
|
|
|
|
# Copy files
|
|
COPY ["files/swss_vars.j2", "/usr/share/sonic/templates/"]
|
|
|
|
## Clean up
|
|
RUN apt-get purge -y build-essential python-dev; apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
|
RUN rm -rf /debs /python-wheels
|