forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_debug_docker_j2.sh
More file actions
executable file
·51 lines (35 loc) · 866 Bytes
/
build_debug_docker_j2.sh
File metadata and controls
executable file
·51 lines (35 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/bash
echo "
ARG BASE=$1
FROM \$BASE AS base
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 apt update
RUN dpkg -i \
{% for deb in $2.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %} || apt -y install -f --no-remove
{% endif %}
{% endif %}
{% if $3 is defined %}
{% if $3|length %}
RUN apt 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
FROM \$BASE
RUN --mount=type=bind,from=base,target=/changes-to-image rsync -axAX --no-D --exclude=/sys --exclude=/proc --exclude=/dev --exclude=resolv.conf /changes-to-image/ /
"