Skip to content

Commit

Permalink
Open5GS WebUI and dbctl images updated to use open5gs user (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpontongradiant authored Sep 5, 2024
1 parent ddc1920 commit df6f012
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 9 additions & 1 deletion images/open5gs-dbctl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
FROM mongo:latest

ARG version
ENV VERSION=$version
ENV VERSION=$version \
USER=open5gs \
GROUP=open5gs

RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y wget && \
apt-get clean

RUN wget -O /usr/local/bin/open5gs-dbctl https://github.com/open5gs/open5gs/raw/main/misc/db/open5gs-dbctl && \
chmod +x /usr/local/bin/open5gs-dbctl

RUN groupadd -r $GROUP && \
useradd --comment "open5gs" --shell /bin/bash -M -r -g $GROUP $USER
RUN chown -R $GROUP:$USER /usr/local/bin/open5gs-dbctl
USER open5gs

ENTRYPOINT ["bin/bash", "-c"]

CMD ["/usr/local/bin/open5gs-dbctl"]
7 changes: 4 additions & 3 deletions images/open5gs-webui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.10.0-bullseye as dev
FROM node:20.10.0-bullseye AS dev
LABEL maintainer="cgiraldo@gradiant.org" \
organization="gradiant.org"

Expand All @@ -19,8 +19,7 @@ RUN cd /opt/open5gs-${VERSION}/webui && npm install && npm run build
FROM node:20.10.0-bullseye-slim


ENV VERSION=$version \
USER=open5gs \
ENV USER=open5gs \
GROUP=open5gs \
DB_URI=mongodb://mongo/open5gs

Expand All @@ -33,5 +32,7 @@ WORKDIR /opt/open5gs-webui
RUN npm run-script build
ENV NODE_ENV=production
ENV HOSTNAME="0.0.0.0"
RUN chown -R $GROUP:$USER /opt/open5gs-webui/
USER open5gs
ENTRYPOINT ["node", "server/index.js"]

0 comments on commit df6f012

Please sign in to comment.