From bcb71eb969fcfd13500df857ea7673c3510d7a10 Mon Sep 17 00:00:00 2001 From: gatici Date: Fri, 28 Jul 2023 14:31:49 +0300 Subject: [PATCH] Fix RO Dockerfile.local Build RO images using Ubuntu 22.04 Change-Id: Ia74a8bf79390fdf0f09ac3b05f0a5ba8d9346d50 Signed-off-by: gatici --- Dockerfile.local | 19 ++++++++++++++--- ...fix_dockerfile_local-2755bc265117bf2b.yaml | 21 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix_dockerfile_local-2755bc265117bf2b.yaml diff --git a/Dockerfile.local b/Dockerfile.local index 843e0537..1aea781f 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -14,7 +14,7 @@ # under the License. ############################################################################ -FROM ubuntu:20.04 as INSTALL +FROM ubuntu:22.04 as INSTALL WORKDIR /build @@ -85,13 +85,13 @@ RUN python3 -m build /build/RO-VIM-gcp && \ RUN python3 -m build /build/RO-SDN-tapi && \ python3 -m pip install /build/RO-SDN-tapi/dist/*.whl -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \ DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal 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/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage COPY --from=INSTALL /etc/protocols /etc/protocols @@ -99,6 +99,19 @@ VOLUME /var/log/osm EXPOSE 9090 +# Creating the user for the app +RUN groupadd -g 1000 appuser && \ + useradd -u 1000 -g 1000 -d /app appuser && \ + mkdir -p /app/osm_ro && \ + mkdir -p /app/storage/kafka && \ + mkdir /app/log && \ + chown -R appuser:appuser /app + +WORKDIR /app/osm_ro + +# Changing the security context +USER appuser + # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers # These ENV must be provided ENV RO_DB_HOST="" diff --git a/releasenotes/notes/fix_dockerfile_local-2755bc265117bf2b.yaml b/releasenotes/notes/fix_dockerfile_local-2755bc265117bf2b.yaml new file mode 100644 index 00000000..8b664989 --- /dev/null +++ b/releasenotes/notes/fix_dockerfile_local-2755bc265117bf2b.yaml @@ -0,0 +1,21 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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. +####################################################################################### +--- +fixes: + - | + Fix RO Dockerfile.local + Build RO images using Ubuntu 22.04. -- 2.25.1