diff --git a/gitbucket.dockerfile b/gitbucket.dockerfile index 1864702..098bad9 100644 --- a/gitbucket.dockerfile +++ b/gitbucket.dockerfile @@ -1,24 +1,27 @@ # A minimal GitBucket. # # Volumes: -# /gitbucket - GitBucket persistent data. Precreate to prevent Docker creating with root privs. -# /opt/gitbucket - location of gitbucket.war (parent directory) +# /gitbucket_data - GitBucket persistent data. Precreate to prevent Docker creating with root privs. +# /opt/gitbucket - location of gitbucket.war (parent directory). Plugins should reside in a 'plugins' directory inside this directory. # # Build with: -# >docker build . +# > docker build . # # Run with: -# >docker run --detach --publish 8080:8080 --volume data_location:/gitbucket --volume war_location:/opt/gitbucket -e GITBUCKET_PREFIX=/prefix +# > docker run --detach --publish 8080:8080 --volume data_location:/gitbucket_data --volume war_location:/opt/gitbucket --env GITBUCKET_PREFIX=/prefix # -# Configuration changes can be made via environment variables, so override by supplying -e parameters (or an env file). +# Configuration changes can be made via environment variables, so override by supplying --env parameters (or an env file). # start with the Alpine Adoptium base -FROM eclipse-temurin:11-alpine as jre-build +FROM eclipse-temurin:17-alpine as jre-build # Java module dependencies found by unzipping WAR and running: # jdeps --class-path 'WEB-INF/classes,WEB-INF/lib/*,.' -recursive -summary . +# jdeps currently requires objc from binutils +RUN apk add --no-cache binutils + # generate a minimal JRE that includes only the necessary modules RUN $JAVA_HOME/bin/jlink \ --add-modules java.base,java.desktop,java.instrument,java.logging,java.management,java.naming,java.security.jgss,java.sql,java.xml \ @@ -38,23 +41,24 @@ ### INSTALL DEPENDENCIES ### -# font support needed for generating avatar icons, curl needed for healthcheck -RUN apk add --no-cache fontconfig ttf-opensans curl +# font support needed for generating avatar icons, curl needed for healthcheck, graphviz needed by plantuml plugin +RUN apk add --no-cache graphviz fontconfig ttf-opensans curl -### DEPLOY APPLICATION ### +RUN \ + addgroup gitbucket && \ + adduser --disabled-password -G gitbucket gitbucket && \ + mkdir /home/gitbucket/tmp -#RUN mkdir /opt/gitbucket -#COPY gitbucket.war /opt/gitbucket - -RUN addgroup gitbucket && adduser -D -G gitbucket gitbucket USER gitbucket +# These are variables that GitBucket looks for. Override when starting container (--env on Docker) if needed. +# See: https://github.com/gitbucket/gitbucket/wiki/Basic-configurations ENV \ - GITBUCKET_HOME=/gitbucket/gitbucket-data \ + GITBUCKET_HOME="/gitbucket/gitbucket_data" \ GITBUCKET_PORT=8080 \ GITBUCKET_PREFIX="" \ - GITBUCKET_PLUGINDIR="" \ - GITBUCKET_TMPDIR="" + GITBUCKET_PLUGINDIR="/opt/gitbucket/plugins" \ + GITBUCKET_TEMPDIR="/home/gitbucket/tmp" EXPOSE 8080/tcp