Skip to content

Commit

Permalink
Make sure environment variables are present in the second (final) stage
Browse files Browse the repository at this point in the history
Signed-off-by: Saikrishna Arcot <[email protected]>
  • Loading branch information
saiarcot895 committed Sep 1, 2024
1 parent add3456 commit 61be6bc
Show file tree
Hide file tree
Showing 31 changed files with 76 additions and 33 deletions.
1 change: 1 addition & 0 deletions dockers/docker-database/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/docker-database-init.sh"]
7 changes: 4 additions & 3 deletions dockers/docker-dhcp-relay/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ ARG image_version
# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

# Update apt's cache of available packages
RUN apt-get update

Expand Down Expand Up @@ -62,4 +59,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker_init.sh"]
7 changes: 4 additions & 3 deletions dockers/docker-dhcp-server/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ ARG image_version
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

RUN apt-get update && \
apt-get install -f -y \
tcpdump \
Expand Down Expand Up @@ -56,4 +53,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker_init.sh"]
7 changes: 4 additions & 3 deletions dockers/docker-eventd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ ARG image_version
# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

# Update apt's cache of available packages
RUN apt-get update

Expand All @@ -32,4 +29,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker_init.sh"]
1 change: 1 addition & 0 deletions dockers/docker-iccpd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
4 changes: 4 additions & 0 deletions dockers/docker-lldp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker-lldp-init.sh"]
1 change: 1 addition & 0 deletions dockers/docker-macsec/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-mux/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker-init.sh"]
4 changes: 1 addition & 3 deletions dockers/docker-nat/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ COPY ["restore_nat_entries.py", "/usr/bin/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker-init.sh"]
4 changes: 4 additions & 0 deletions dockers/docker-platform-monitor/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker_init.sh"]
4 changes: 4 additions & 0 deletions dockers/docker-router-advertiser/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ FROM $BASE

COPY --from=base / /

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/bin/docker-init.sh"]
1 change: 1 addition & 0 deletions dockers/docker-sflow/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
26 changes: 16 additions & 10 deletions dockers/docker-snmp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG docker_container_name
ARG image_version

# Enable -O for all Python calls
ENV PYTHONOPTIMIZE 1
ENV PYTHONOPTIMIZE=1

# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -32,15 +32,6 @@ RUN apt-get update && \
{{ install_debian_packages(docker_snmp_debs.split(' ')) }}
{%- endif %}

# Fix for hiredis compilation issues for ARM
# python will throw for missing locale
RUN apt-get install -y locales
RUN locale-gen "en_US.UTF-8"
RUN dpkg-reconfigure --frontend noninteractive locales
ENV LC_CTYPE=en_US.UTF-8
RUN sed -i '/^#.* en_US.* /s/^#//' /etc/locale.gen
RUN locale-gen

# Install dependencies used by some plugins
RUN pip3 install --no-cache-dir \
hiredis \
Expand All @@ -57,6 +48,12 @@ RUN pip3 install --no-cache-dir \

RUN python3 -m sonic_ax_impl install

# Clean up
RUN apt-get -y purge \
python3-dev \
gcc \
make

COPY ["start.sh", "/usr/bin/"]
COPY ["snmp_yml_to_configdb.py", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
Expand All @@ -71,4 +68,13 @@ FROM $BASE

COPY --from=base / /

# Enable -O for all Python calls
ENV PYTHONOPTIMIZE=1

# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENTRYPOINT ["/usr/local/bin/supervisord"]
6 changes: 6 additions & 0 deletions dockers/docker-sonic-gnmi/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ FROM $BASE

COPY --from=base / /

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-sonic-p4rt/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-sonic-restapi/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
6 changes: 6 additions & 0 deletions dockers/docker-sonic-telemetry/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ FROM $BASE

COPY --from=base / /

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-teamd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm-dnx-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm-dnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/mellanox/docker-syncd-mlnx/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
8 changes: 4 additions & 4 deletions platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ COPY ["frr/zebra.conf", "/etc/frr/"]
# Create /var/warmboot/teamd folder for teammgrd
RUN mkdir -p /var/warmboot/teamd

# Set PLATFORM and HWSKU environment variables
ENV PLATFORM=x86_64-kvm_x86_64-r0
ENV HWSKU=Force10-S6000

FROM $BASE

COPY --from=base / /

# Set PLATFORM and HWSKU environment variables
ENV PLATFORM=x86_64-kvm_x86_64-r0
ENV HWSKU=Force10-S6000

ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/vs/docker-syncd-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ FROM $BASE

COPY --from=base / /

ENV DEBIAN_FRONTEND=noninteractive
ENTRYPOINT ["/usr/local/bin/supervisord"]
7 changes: 0 additions & 7 deletions platform/vs/syncd-vs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ $(LIBSAIREDIS)_DEB_BUILD_PROFILES += syncd vs
SYNCD_VS = syncd-vs_1.0.0_$(CONFIGURED_ARCH).deb
$(SYNCD_VS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBSAIVS)

ifeq ($(BLDENV),bookworm)
$(LIBSAIREDIS)_DEB_BUILD_PROFILES += dashsai
$(LIBSAIREDIS)_DEPENDS += $(DASH_SAI)
$(SYNCD_VS)_RDEPENDS += $(DASH_SAI)
else
$(warning DASH_SAI cannot support this build environment $(BLDENV))
endif


$(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_VS)))
Expand Down

0 comments on commit 61be6bc

Please sign in to comment.