Skip to content

Commit

Permalink
Set USER in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Jan 9, 2025
1 parent 67f031e commit f7e6c89
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 11 deletions.
9 changes: 7 additions & 2 deletions pass-deposit-services/deposit-core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ COPY target/deposit-core-*-exec.jar pass-deposit-service-exec.jar
COPY entrypoint.sh .

RUN apt update \
&& apt install -y curl \
&& apt --no-install-recommends install -y curl \
&& chmod +x entrypoint.sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passdsgroup \
&& useradd -m -u 1532 -g passdsgroup passdsuser \
&& chown -R passdsuser:passdsgroup /app

USER passdsuser

ENTRYPOINT ["./entrypoint.sh"]
9 changes: 7 additions & 2 deletions pass-grant-loader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ COPY target/pass-grant-loader-*-exec.jar jhu-grant-loader-exec.jar
COPY entrypoint.sh .

RUN apt update \
&& apt install -y curl \
&& apt --no-install-recommends install -y curl \
&& chmod +x entrypoint.sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passglgroup \
&& useradd -m -u 1532 -g passglgroup passgluser \
&& chown -R passgluser:passglgroup /app

USER passgluser

ENTRYPOINT ["./entrypoint.sh"]
CMD ["--help"]
9 changes: 7 additions & 2 deletions pass-journal-loader/pass-journal-loader-nih/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ COPY target/pass-journal-loader-nih-*-exec.jar pass-journal-loader-nih-exec.jar
COPY entrypoint.sh .

RUN apt update \
&& apt install -y curl \
&& apt --no-install-recommends install -y curl \
&& chmod +x entrypoint.sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passjlgroup \
&& useradd -m -u 1532 -g passjlgroup passjluser \
&& chown -R passjluser:passjlgroup /app

USER passjluser

ENTRYPOINT ["./entrypoint.sh"]
9 changes: 7 additions & 2 deletions pass-nihms-loader/nihms-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ COPY ./target/nihms-data-transform-load-*-exec.jar nihms-data-transform-load-exe
COPY entrypoint.sh .

RUN apt update \
&& apt install -y curl \
&& apt --no-install-recommends install -y curl \
&& chmod +x entrypoint.sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passnlgroup \
&& useradd -m -u 1532 -g passnlgroup passnluser \
&& chown -R passnluser:passnlgroup /app

USER passnluser

ENTRYPOINT ["./entrypoint.sh"]
7 changes: 6 additions & 1 deletion pass-nihms-loader/nihms-token-refresh/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ RUN chmod +x entrypoint.sh \
&& chmod +x run_refresh.sh \
&& chmod +x set_aws_param_store.sh \
&& npm install \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passntrgroup \
&& useradd -m -u 1532 -g passntrgroup passntruser \
&& chown -R passntruser:passntrgroup /app

USER passntruser

ENTRYPOINT ["./entrypoint.sh"]
9 changes: 7 additions & 2 deletions pass-notification-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ COPY target/pass-notification-service-*-exec.jar pass-notification-service-exec.
COPY entrypoint.sh .

RUN apt update \
&& apt install -y curl \
&& apt --no-install-recommends install -y curl \
&& chmod +x entrypoint.sh \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1432 passnsgroup \
&& useradd -m -u 1532 -g passnsgroup passnsuser \
&& chown -R passnsuser:passnsgroup /app

USER passnsuser

ENTRYPOINT ["./entrypoint.sh"]

0 comments on commit f7e6c89

Please sign in to comment.