From: Mark Beierl Date: Thu, 8 Sep 2022 09:44:06 +0000 (-0400) Subject: Bug 2139: OSM OCI images have 172.21.1.1 as apt proxy X-Git-Tag: release-v13.0-start~40 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=e5b9ba619c48d8768a3e75ed35883c034c38e107;p=osm%2Fdevops.git Bug 2139: OSM OCI images have 172.21.1.1 as apt proxy Removes the apt proxy configuration from the final image layers Change-Id: I3f2dfd81a04b42d3ee570cdc71ca41da39e621d0 Signed-off-by: Mark Beierl --- diff --git a/docker/LCM/Dockerfile b/docker/LCM/Dockerfile index f662d7bd..48fcede4 100644 --- a/docker/LCM/Dockerfile +++ b/docker/LCM/Dockerfile @@ -91,6 +91,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ ca-certificates \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages diff --git a/docker/MON/Dockerfile b/docker/MON/Dockerfile index f1409336..cd56f536 100644 --- a/docker/MON/Dockerfile +++ b/docker/MON/Dockerfile @@ -73,6 +73,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ ca-certificates \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages COPY --from=INSTALL /usr/bin/osm* /usr/bin/ diff --git a/docker/NBI/Dockerfile b/docker/NBI/Dockerfile index e43a0377..89574791 100644 --- a/docker/NBI/Dockerfile +++ b/docker/NBI/Dockerfile @@ -64,6 +64,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ python3-minimal=3.8.* \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages diff --git a/docker/NG-UI/Dockerfile b/docker/NG-UI/Dockerfile index c4d67df9..74aa1d46 100644 --- a/docker/NG-UI/Dockerfile +++ b/docker/NG-UI/Dockerfile @@ -62,6 +62,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ nginx=1.18.* && \ rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + # Removing the Nginx default page. RUN rm -rf /usr/share/nginx/html/* diff --git a/docker/PLA/Dockerfile b/docker/PLA/Dockerfile index 282a8329..f6373625 100644 --- a/docker/PLA/Dockerfile +++ b/docker/PLA/Dockerfile @@ -17,18 +17,6 @@ FROM ubuntu:20.04 as INSTALL -ARG APT_PROXY -RUN if [ ! -z $APT_PROXY ] ; then \ - echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ - echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\ - fi - -ARG APT_PROXY -RUN if [ ! -z $APT_PROXY ] ; then \ - echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ - echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\ - fi - ARG APT_PROXY RUN if [ ! -z $APT_PROXY ] ; then \ echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ @@ -76,6 +64,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ python3-minimal=3.8.* \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + LABEL authors="Lars-Göran Magnusson" COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages @@ -102,7 +92,7 @@ RUN groupadd -g 1000 appuser && \ WORKDIR /app/osm_pla # Changing the security context -USER appuser +USER appuser ENV OSMPLA_MESSAGE_DRIVER kafka ENV OSMPLA_MESSAGE_HOST kafka diff --git a/docker/POL/Dockerfile b/docker/POL/Dockerfile index db584b87..b807bfdb 100644 --- a/docker/POL/Dockerfile +++ b/docker/POL/Dockerfile @@ -63,6 +63,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ python3-minimal=3.8.* \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages COPY --from=INSTALL /usr/bin/osm* /usr/bin/ diff --git a/docker/RO/Dockerfile b/docker/RO/Dockerfile index 0a98deea..64bad452 100644 --- a/docker/RO/Dockerfile +++ b/docker/RO/Dockerfile @@ -98,6 +98,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ python3-minimal=3.8.* \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage diff --git a/docker/osmclient/Dockerfile b/docker/osmclient/Dockerfile index 088cd4d9..ae4a1ab9 100644 --- a/docker/osmclient/Dockerfile +++ b/docker/osmclient/Dockerfile @@ -17,12 +17,6 @@ FROM ubuntu:20.04 as INSTALL -ARG APT_PROXY -RUN if [ ! -z $APT_PROXY ] ; then \ - echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ - echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\ - fi - ARG APT_PROXY RUN if [ ! -z $APT_PROXY ] ; then \ echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ @@ -41,7 +35,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ DEBIAN_FRONTEND=noninteractive apt-get --yes install \ libcurl4-openssl-dev=7.68.* \ - libssl-dev=1.1.* + libssl-dev=1.1.* ARG PYTHON3_OSMCLIENT_URL ARG PYTHON3_OSM_IM_URL @@ -70,6 +64,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ python3-minimal=3.8.* \ && rm -rf /var/lib/apt/lists/* +RUN rm -f /etc/apt/apt.conf.d/proxy.conf + COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages