Gitblit image based on Java image from Docker Hub
Jacek Kowalski
2017-03-19 b8ba7bacb0c494a2a77c03a6fe9b97807bc31285
commit | author | age
b8ba7b 1 FROM openjdk:jre
380b73 2 MAINTAINER Jacek Kowalski <Jacek@jacekk.info>
JK 3
a93b4e 4 ENV GITBLIT_VERSION 1.8.0
380b73 5
JK 6 RUN apt-get update \
7     && apt-get dist-upgrade -y \
8     && apt-get install -y git-core sudo wget \
9     && apt-get clean
10
11 # Install Gitblit
12
13 WORKDIR /opt
14 RUN wget -O /tmp/gitblit.tar.gz http://dl.bintray.com/gitblit/releases/gitblit-${GITBLIT_VERSION}.tar.gz \
15     && tar xzf /tmp/gitblit.tar.gz \
16     && rm -f /tmp/gitblit.tar.gz \
17     && ln -s gitblit-${GITBLIT_VERSION} gitblit \
18     && mv gitblit/data gitblit-data-initial \
19     && mkdir gitblit-data
20 RUN groupadd -r -g 500 gitblit \
21     && useradd -r -d /opt/gitblit-data -u 500 -g 500 gitblit \
22     && chown -Rf gitblit:gitblit /opt/gitblit-*
23
24 # Adjust the default Gitblit settings to bind to 8080, 8443, 9418, 29418, and allow RPC administration.
25
26 RUN echo "server.httpPort=8080" >> gitblit-data-initial/gitblit.properties \
27     && echo "server.httpsPort=8443" >> gitblit-data-initial/gitblit.properties \
28     && echo "web.enableRpcManagement=true" >> gitblit-data-initial/gitblit.properties \
29     && echo "web.enableRpcAdministration=true" >> gitblit-data-initial/gitblit.properties
30
31 # Setup the Docker container environment and run Gitblit
32
33 VOLUME /opt/gitblit-data
34 EXPOSE 8080 8443 9418 29418
35
36 WORKDIR /opt/gitblit
37 COPY run.sh /run.sh
38 CMD /run.sh