From 28ec71bd516b7186bdb941b49bd1577f04d06bc7 Mon Sep 17 00:00:00 2001 From: sousaedu Date: Fri, 30 Jul 2021 11:52:48 +0200 Subject: [PATCH] Fix bug 1619 - adding start script to LCM to install CA certificates Change-Id: I900b8e7db66924e8f12dbc6ce3b9a10cbc14f160 Signed-off-by: sousaedu --- docker/LCM/Dockerfile | 11 ++++++++--- docker/LCM/scripts/start.sh | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 docker/LCM/scripts/start.sh diff --git a/docker/LCM/Dockerfile b/docker/LCM/Dockerfile index 8215fd94..14850eaa 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 @@ -127,6 +128,10 @@ ENV OSMLCM_VCA_HELMPATH /usr/local/bin/helm ENV OSMLCM_VCA_KUBECTLPATH /usr/bin/kubectl 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 # ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG @@ -136,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 -- 2.17.1