Skip to content

Commit

Permalink
feat: change app,data&conf dir to 0(root) group so it's openshift fri…
Browse files Browse the repository at this point in the history
…endly (#200)

Signed-off-by: Tuan Anh Tran <[email protected]>
  • Loading branch information
tuananh authored Dec 14, 2021
1 parent 4421116 commit 83ee0a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom/hardened-alpine/infra/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ RUN apk add --no-cache ca-certificates
RUN adduser -s /bin/true -u 1000 -D -h $APP_DIR $APP_USER \
&& mkdir "$DATA_DIR" "$CONF_DIR" \
&& chown -R "$APP_USER" "$APP_DIR" "$CONF_DIR" \
&& chmod 700 "$APP_DIR" "$DATA_DIR" "$CONF_DIR"
&& chmod 700 "$APP_DIR" "$DATA_DIR" "$CONF_DIR" \
# change to 0(root) group because openshift will run container with arbitrary uid as a member of root group
&& chgrp -R 0 "$APP_DIR" "$DATA_DIR" "$CONF_DIR" \
&& chmod -R g=u "$APP_DIR" "$DATA_DIR" "$CONF_DIR"

# Remove existing crontabs, if any.
RUN rm -fr /var/spool/cron \
Expand Down

0 comments on commit 83ee0a9

Please sign in to comment.