Skip to content

Commit 8e4953b

Browse files
heliocastrotsteenbe
authored andcommitted
docker: Run with defined user (default: ort)
Signed-off-by: Helio Chissini de Castro <[email protected]>
1 parent 2a9839e commit 8e4953b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ COPY "$CRT_FILES" /tmp/certificates/
103103
RUN /etc/scripts/export_proxy_certificates.sh /tmp/certificates/ \
104104
&& /etc/scripts/import_certificates.sh /tmp/certificates/
105105

106+
USER $USER
107+
WORKDIR $HOME
108+
106109
ENTRYPOINT [ "/bin/bash" ]
107110

108111
#------------------------------------------------------------------------
@@ -447,8 +450,8 @@ FROM components AS run
447450
COPY --from=ort --chown=$USER:$USER /opt/ort /opt/ort
448451
ENV PATH=$PATH:/opt/ort/bin
449452

450-
USER $USERNAME
451-
WORKDIR $HOMEDIR
453+
USER $USER
454+
WORKDIR $HOME
452455

453456
# Ensure that the ORT data directory exists to be able to mount the config into it with correct permissions.
454457
RUN mkdir -p "$HOMEDIR/.ort"

0 commit comments

Comments
 (0)