go.ligato.io/vpp-agent/v3@v3.5.0/docker/prod/Dockerfile (about)

     1  ARG DEV_IMG=dev_vpp_agent
     2  FROM ${DEV_IMG} as devimg
     3  
     4  FROM ubuntu:20.04 as base
     5  
     6  RUN apt-get update && apt-get install -y --no-install-recommends \
     7  		# general tools
     8  		inetutils-traceroute \
     9  		iproute2 \
    10  		iputils-ping \
    11  		# vpp requirements
    12  		ca-certificates \
    13  		libapr1 \
    14  		libc6 \
    15  		libmbedx509-0 \
    16  		libnuma1 \
    17  		openssl \
    18   	&& rm -rf /var/lib/apt/lists/*
    19  
    20  # install vpp
    21  COPY --from=devimg /vpp/*.deb /opt/vpp/
    22  
    23  RUN set -eux; \
    24  	cd /opt/vpp/; \
    25  	apt-get update; \
    26  	apt-get install -y ./*.deb; \
    27  	rm *.deb; \
    28  	rm -rf /var/lib/apt/lists/*;
    29  
    30  # Copy configs
    31  COPY \
    32  	etcd.conf \
    33  	grpc.conf \
    34  	supervisor.conf \
    35   /opt/vpp-agent/dev/
    36  
    37  COPY vpp.conf /etc/vpp/vpp.conf
    38  COPY init_hook.sh /usr/bin/
    39  
    40  # handle differences in vpp.conf which are between supported VPP versions
    41  ARG VPP_VERSION
    42  COPY legacy-nat.conf /tmp/legacy-nat.conf
    43  RUN if [ "$VPP_VERSION" -le 2009 ]; then \
    44  		cat /tmp/legacy-nat.conf >> /etc/vpp/vpp.conf; \
    45  	fi; \
    46  	rm /tmp/legacy-nat.conf
    47  
    48  # Install agent
    49  COPY --from=devimg \
    50      /go/bin/agentctl \
    51      /go/bin/vpp-agent \
    52      /go/bin/vpp-agent-init \
    53   /bin/
    54  
    55  # Final image
    56  FROM scratch
    57  COPY --from=base / /
    58  
    59  WORKDIR /root/
    60  
    61  ENV SUPERVISOR_CONFIG=/opt/vpp-agent/dev/supervisor.conf
    62  
    63  CMD rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api && \
    64  	mkdir -p /run/vpp && \
    65  	exec vpp-agent-init