Skip to content

Changed the root user to a non-root user #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions 4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ LABEL maintainer="Naoki Takezoe <takezoe [at] gmail.com>"

ADD https://github.com/gitbucket/gitbucket/releases/download/4.33.0/gitbucket.war /opt/gitbucket.war

RUN ln -s /gitbucket /root/.gitbucket
ENV GITBUCKET_HOME=/gitbucket

# Give permissions for root group
RUN chmod g=u /opt/gitbucket.war && \
mkdir -p $GITBUCKET_HOME && \
chmod g+w $GITBUCKET_HOME

VOLUME $GITBUCKET_HOME

VOLUME /gitbucket

# Port for web page
EXPOSE 8080
# Port for SSH access to git repository (Optional)
EXPOSE 29418

ARG USERID=1001
USER ${USERID}

CMD ["sh", "-c", "java -jar /opt/gitbucket.war"]