From: sousaedu Date: Fri, 30 Jul 2021 09:52:48 +0000 (+0200) Subject: Fix bug 1617 - adding start script to LCM to install CA certificates X-Git-Tag: v10.0.2~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=fa6cbc1751c16fddf466a27bb741c17671eaffd9;p=osm%2Fdevops.git Fix bug 1617 - adding start script to LCM to install CA certificates Change-Id: I900b8e7db66924e8f12dbc6ce3b9a10cbc14f160 Signed-off-by: sousaedu --- diff --git a/docker/LCM/Dockerfile b/docker/LCM/Dockerfile index 81524a97..6cb51a28 100644 --- a/docker/LCM/Dockerfile +++ b/docker/LCM/Dockerfile @@ -70,8 +70,7 @@ FROM ubuntu:18.04 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04 -RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \ - ca-certificates +RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install ca-certificates COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages /usr/local/lib/python3.6/dist-packages @@ -85,6 +84,8 @@ COPY --from=INSTALL /usr/bin/ssh /usr/bin/ssh COPY --from=INSTALL /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ COPY --from=INSTALL /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/ +COPY scripts/ scripts/ + ######################################################################## # Used for local storage @@ -129,6 +130,7 @@ ENV OSMLCM_VCA_JUJUPATH /usr/local/bin/juju # helm ENV OSMLCM_VCA_STABLEREPOURL https://charts.helm.sh/stable +# ENV OSMLCM_VCA_HELM_CA_CERTS # logs # ENV OSMLCM_GLOBAL_LOGFILE /app/log/lcm.log @@ -139,5 +141,5 @@ HEALTHCHECK --start-period=120s --interval=30s --timeout=30s --retries=1 \ # Run app.py when the container launches -CMD python3 -m osm_lcm.lcm +CMD [ "/bin/bash", "scripts/start.sh" ] diff --git a/docker/LCM/scripts/start.sh b/docker/LCM/scripts/start.sh new file mode 100644 index 00000000..f35e1875 --- /dev/null +++ b/docker/LCM/scripts/start.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +############################################################################### +# Copyright 2021 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################### + +if [ "$OSMLCM_VCA_HELM_CA_CERTS" ]; then + echo "$OSMLCM_VCA_HELM_CA_CERTS" >> /etc/ssl/certs/ca-certificates.crt +fi + +python3 -m osm_lcm.lcm