Skip to content

Commit

Permalink
The user d1indexer rather than root to run the container.
Browse files Browse the repository at this point in the history
  • Loading branch information
taojing2002 committed Feb 2, 2023
1 parent c9b5fc3 commit 4b096f7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ RUN apt install figlet
RUN apt install curl
RUN apt install nano

#Add a user with name d1indexer
RUN useradd d1indexer

# The most recently built jar file is copied from the maven build directory to this dir by maven, so that
# it can be copied to the image.
COPY ../target/dataone-index-worker-${TAG}-shaded.jar .
COPY ./docker/entrypoint.sh .

# Change the ownership of the jar and sh files
RUN chown d1indexer dataone-index-worker-${TAG}-shaded.jar
RUN chown d1indexer entrypoint.sh

#Run Container as d1indexer
USER d1indexer

# Connect this image to a GitHub repository
LABEL org.opencontainers.image.source https://github.com/dataoneorg/dataone-indexer

Expand Down

0 comments on commit 4b096f7

Please sign in to comment.