X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=Dockerfile.local;h=1aea781f8f36c72e7987cc69c8bb851f01d014d8;hb=309b5bff8b1d25262c405b93e6362be39cbe0918;hp=99581389a01ac403d6a13f01921c08a72d6428a0;hpb=2cf9ebb837938ce70f6a52a559f4324817890f6d;p=osm%2FRO.git diff --git a/Dockerfile.local b/Dockerfile.local index 99581389..1aea781f 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -14,7 +14,7 @@ # under the License. ############################################################################ -FROM ubuntu:18.04 as INSTALL +FROM ubuntu:22.04 as INSTALL WORKDIR /build @@ -55,9 +55,6 @@ RUN python3 -m build /build/RO-VIM-aws && \ RUN python3 -m build /build/RO-VIM-azure && \ python3 -m pip install /build/RO-VIM-azure/dist/*.whl -RUN python3 -m build /build/RO-VIM-fos && \ - python3 -m pip install /build/RO-VIM-fos/dist/*.whl - RUN python3 -m build /build/RO-SDN-dynpac && \ python3 -m pip install /build/RO-SDN-dynpac/dist/*.whl @@ -82,13 +79,19 @@ RUN python3 -m build /build/RO-SDN-arista_cloudvision && \ RUN python3 -m build /build/RO-SDN-juniper_contrail && \ python3 -m pip install /build/RO-SDN-juniper_contrail/dist/*.whl -FROM ubuntu:18.04 +RUN python3 -m build /build/RO-VIM-gcp && \ + python3 -m pip install /build/RO-VIM-gcp/dist/*.whl + +RUN python3 -m build /build/RO-SDN-tapi && \ + python3 -m pip install /build/RO-SDN-tapi/dist/*.whl + +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.6/dist-packages /usr/local/lib/python3.6/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 @@ -96,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=""