sonic-buildimage/build_debug_docker_j2.sh
abdosi 63b00382ef [sonic-buildimage] Fix build issue for docker-dhcp-relay-dbg.gz. Issue (#4136)
is coming becuase some of debian package not able to fetch.

Signed-off-by: Abhishek <abdosi@microsoft.com>
2020-02-13 16:07:00 -08:00

45 lines
636 B
Bash
Executable File

#! /bin/bash
echo "
FROM $1
ARG docker_container_name
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
{% if $2 is defined %}
{% if $2|length %}
COPY \
{% for deb in $2.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in $2.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
{% endif %}
{% endif %}
{% if $3 is defined %}
{% if $3|length %}
RUN apt-get update && apt-get install -f -y \
{% for dbg in $3.split(' ') -%}
{{ dbg }}{{' '}}
{%- endfor %}
{% endif %}
{% endif %}
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
"