sonic-buildimage/dockers/docker-config-engine/Dockerfile.j2
Joe LeVeque d40c9a1e8d
[docker-base-buster][docker-config-engine-buster] No longer install Python 2 (#6162)
**- Why I did it**

As part of migrating SONiC codebase from Python 2 to Python 3

**- How I did it**

- No longer install Python 2 in docker-base-buster or docker-config-engine-buster.
- Install Python 2 and pip2 in the following containers until we can completely eliminate it there:
    - docker-platform-monitor
    - docker-sonic-mgmt-framework
    - docker-sonic-vs
- Pin pip2 version <21 where it is still temporarily needed, as pip version 21 will drop support for Python 2
- Also preform some other cleanup, ensuring that pip3, setuptools and wheel packages are installed in docker-base-buster, and then removing any attempts to re-install them in derived containers
2020-12-25 21:29:25 -08:00

47 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-dev
{% 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