diff --git a/bitbucket/.docker-repository.yml b/bitbucket/latest/.docker-repository.yml similarity index 100% rename from bitbucket/.docker-repository.yml rename to bitbucket/latest/.docker-repository.yml diff --git a/bitbucket/.dockerignore b/bitbucket/latest/.dockerignore similarity index 100% rename from bitbucket/.dockerignore rename to bitbucket/latest/.dockerignore diff --git a/bitbucket/Dockerfile b/bitbucket/latest/Dockerfile similarity index 100% rename from bitbucket/Dockerfile rename to bitbucket/latest/Dockerfile diff --git a/bitbucket/Makefile b/bitbucket/latest/Makefile similarity index 100% rename from bitbucket/Makefile rename to bitbucket/latest/Makefile diff --git a/bitbucket/README.md b/bitbucket/latest/README.md similarity index 100% rename from bitbucket/README.md rename to bitbucket/latest/README.md diff --git a/bitbucket/entrypoint.sh b/bitbucket/latest/entrypoint.sh similarity index 100% rename from bitbucket/entrypoint.sh rename to bitbucket/latest/entrypoint.sh diff --git a/bitbucket/hooks/post_push b/bitbucket/latest/hooks/post_push similarity index 100% rename from bitbucket/hooks/post_push rename to bitbucket/latest/hooks/post_push diff --git a/confluence/5.10.8/init b/confluence/5.10.8/init new file mode 100644 index 000000000..b1b716105 --- /dev/null +++ b/confluence/5.10.8/init @@ -0,0 +1 @@ +init diff --git a/confluence/5.6.4/init b/confluence/5.6.4/init new file mode 100644 index 000000000..b1b716105 --- /dev/null +++ b/confluence/5.6.4/init @@ -0,0 +1 @@ +init diff --git a/confluence/.docker-repository.yml b/confluence/latest/.docker-repository.yml similarity index 100% rename from confluence/.docker-repository.yml rename to confluence/latest/.docker-repository.yml diff --git a/confluence/.dockerignore b/confluence/latest/.dockerignore similarity index 100% rename from confluence/.dockerignore rename to confluence/latest/.dockerignore diff --git a/confluence/Dockerfile b/confluence/latest/Dockerfile similarity index 100% rename from confluence/Dockerfile rename to confluence/latest/Dockerfile diff --git a/confluence/Makefile b/confluence/latest/Makefile similarity index 100% rename from confluence/Makefile rename to confluence/latest/Makefile diff --git a/confluence/README.md b/confluence/latest/README.md similarity index 100% rename from confluence/README.md rename to confluence/latest/README.md diff --git a/confluence/entrypoint.sh b/confluence/latest/entrypoint.sh similarity index 100% rename from confluence/entrypoint.sh rename to confluence/latest/entrypoint.sh diff --git a/confluence/hooks/post_push b/confluence/latest/hooks/post_push similarity index 100% rename from confluence/hooks/post_push rename to confluence/latest/hooks/post_push diff --git a/jira/.docker-repository.yml b/jira/7.10.0/.docker-repository.yml similarity index 100% rename from jira/.docker-repository.yml rename to jira/7.10.0/.docker-repository.yml diff --git a/jira/.dockerignore b/jira/7.10.0/.dockerignore similarity index 100% rename from jira/.dockerignore rename to jira/7.10.0/.dockerignore diff --git a/jira/7.10.0/Dockerfile b/jira/7.10.0/Dockerfile new file mode 100644 index 000000000..51b064d9b --- /dev/null +++ b/jira/7.10.0/Dockerfile @@ -0,0 +1,42 @@ +FROM anapsix/alpine-java:8_jdk +MAINTAINER Atlassian Jira Server Team + +ENV RUN_USER daemon +ENV RUN_GROUP daemon + +ENV JIRA_HOME /var/atlassian/application-data/jira +ENV JIRA_INSTALL_DIR /opt/atlassian/jira + +VOLUME ["${JIRA_HOME}"] + +# Expose HTTP port +EXPOSE 8080 + +WORKDIR $JIRA_HOME + +CMD ["/entrypoint.sh", "-fg"] +ENTRYPOINT ["/sbin/tini", "--"] + +#RUN apk update -qq \ +# && update-ca-certificates \ +# && apk add ca-certificates wget curl openssh bash procps openssl perl ttf-dejavu tini libc6-compat \ +# && rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/* + +RUN apk update -qq \ + && apk add ca-certificates wget curl openssh bash procps openssl perl ttf-dejavu tini \ + && update-ca-certificates \ + && rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/* + +COPY entrypoint.sh /entrypoint.sh + +ARG JIRA_VERSION=7.10.0 +ARG DOWNLOAD_URL=http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-${JIRA_VERSION}.tar.gz + + +COPY . /tmp + +RUN mkdir -p ${JIRA_INSTALL_DIR} \ + && curl -L --silent ${DOWNLOAD_URL} | tar -xz --strip-components=1 -C "$JIRA_INSTALL_DIR" \ + && chown -R ${RUN_USER}:${RUN_GROUP} ${JIRA_INSTALL_DIR}/ \ + && sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Djira.home=\${JIRA_HOME}/g' ${JIRA_INSTALL_DIR}/bin/setenv.sh \ + && sed -i -e 's/port="8080"/port="8080" secure="${catalinaConnectorSecure}" scheme="${catalinaConnectorScheme}" proxyName="${catalinaConnectorProxyName}" proxyPort="${catalinaConnectorProxyPort}"/' ${JIRA_INSTALL_DIR}/conf/server.xml diff --git a/jira/Makefile b/jira/7.10.0/Makefile similarity index 100% rename from jira/Makefile rename to jira/7.10.0/Makefile diff --git a/jira/README.md b/jira/7.10.0/README.md similarity index 100% rename from jira/README.md rename to jira/7.10.0/README.md diff --git a/jira/entrypoint.sh b/jira/7.10.0/entrypoint.sh similarity index 100% rename from jira/entrypoint.sh rename to jira/7.10.0/entrypoint.sh diff --git a/jira/hooks/post_push b/jira/7.10.0/hooks/post_push similarity index 100% rename from jira/hooks/post_push rename to jira/7.10.0/hooks/post_push diff --git a/jira/latest/.docker-repository.yml b/jira/latest/.docker-repository.yml new file mode 100644 index 000000000..8dc515604 --- /dev/null +++ b/jira/latest/.docker-repository.yml @@ -0,0 +1 @@ +repository: epicmorg/jira diff --git a/jira/latest/.dockerignore b/jira/latest/.dockerignore new file mode 100644 index 000000000..99176b278 --- /dev/null +++ b/jira/latest/.dockerignore @@ -0,0 +1,3 @@ +.git +scripts +.idea \ No newline at end of file diff --git a/jira/Dockerfile b/jira/latest/Dockerfile similarity index 100% rename from jira/Dockerfile rename to jira/latest/Dockerfile diff --git a/jira/latest/Makefile b/jira/latest/Makefile new file mode 100644 index 000000000..9977f28f7 --- /dev/null +++ b/jira/latest/Makefile @@ -0,0 +1,4 @@ +all: jira + +jira: + docker build --no-cache -t epicmorg/jira . diff --git a/jira/latest/README.md b/jira/latest/README.md new file mode 100644 index 000000000..efcddf73b --- /dev/null +++ b/jira/latest/README.md @@ -0,0 +1,43 @@ +![Atlassian Jira Server](https://www.atlassian.com/dam/wac/legacy/jira_logo_landing.png) + +# Overview + +This Docker unofficial container makes it easy to get an instance of Jira up and running. + +## Memory / Heap Size + +If you need to override Jira Server's default memory allocation, you can control the minimum heap (Xms) and maximum heap (Xmx) via the below environment variables. + +* `JVM_MINIMUM_MEMORY` (default: 1024m) + + The minimum heap size of the JVM + +* `JVM_MAXIMUM_MEMORY` (default: 1024m) + + The maximum heap size of the JVM + +## Reverse Proxy Settings + +If Jira is run behind a reverse proxy server, then you need to specify extra options to make Jira aware of the setup. They can be controlled via the below environment variables. + +* `CATALINA_CONNECTOR_PROXYNAME` (default: NONE) + + The reverse proxy's fully qualified hostname. + +* `CATALINA_CONNECTOR_PROXYPORT` (default: NONE) + + The reverse proxy's port number via which Jira is accessed. + +* `CATALINA_CONNECTOR_SCHEME` (default: http) + + The protocol via which Jira is accessed. + +* `CATALINA_CONNECTOR_SECURE` (default: false) + + Set 'true' if CATALINA_CONNECTOR_SCHEME is 'https'. + +## JVM configuration + +If you need to pass additional JVM arguments to Jira such as specifying a custom trust store, you can add them via the below environment variable + +* `JVM_SUPPORT_RECOMMENDED_ARGS` diff --git a/jira/latest/entrypoint.sh b/jira/latest/entrypoint.sh new file mode 100755 index 000000000..ede4d4bb0 --- /dev/null +++ b/jira/latest/entrypoint.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -euo pipefail + +# Setup Catalina Opts +: ${CATALINA_CONNECTOR_PROXYNAME:=} +: ${CATALINA_CONNECTOR_PROXYPORT:=} +: ${CATALINA_CONNECTOR_SCHEME:=http} +: ${CATALINA_CONNECTOR_SECURE:=false} + +: ${CATALINA_OPTS:=} + +CATALINA_OPTS="${CATALINA_OPTS} -DcatalinaConnectorProxyName=${CATALINA_CONNECTOR_PROXYNAME}" +CATALINA_OPTS="${CATALINA_OPTS} -DcatalinaConnectorProxyPort=${CATALINA_CONNECTOR_PROXYPORT}" +CATALINA_OPTS="${CATALINA_OPTS} -DcatalinaConnectorScheme=${CATALINA_CONNECTOR_SCHEME}" +CATALINA_OPTS="${CATALINA_OPTS} -DcatalinaConnectorSecure=${CATALINA_CONNECTOR_SECURE}" + +export CATALINA_OPTS + + +# Start Confluence as the correct user +if [ "${UID}" -eq 0 ]; then + echo "User is currently root. Will change directory ownership to ${RUN_USER}:${RUN_GROUP}, then downgrade permission to ${RUN_USER}" + PERMISSIONS_SIGNATURE=$(stat -c "%u:%U:%a" "${JIRA_HOME}") + EXPECTED_PERMISSIONS=$(id -u ${RUN_USER}):${RUN_USER}:700 + if [ "${PERMISSIONS_SIGNATURE}" != "${EXPECTED_PERMISSIONS}" ]; then + chmod -R 700 "${JIRA_HOME}" && + chown -R "${RUN_USER}:${RUN_GROUP}" "${JIRA_HOME}" + fi + # Now drop privileges + exec su -s /bin/bash "${RUN_USER}" -c "$JIRA_INSTALL_DIR/bin/start-jira.sh $@" +else + exec "$JIRA_INSTALL_DIR/bin/start-jira.sh" "$@" +fi diff --git a/jira/latest/hooks/post_push b/jira/latest/hooks/post_push new file mode 100644 index 000000000..e4643e10a --- /dev/null +++ b/jira/latest/hooks/post_push @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Parse image name for repo name +tagStart=$(expr index "$IMAGE_NAME" :) +repoName=${IMAGE_NAME:0:tagStart-1} + +# Tag and push image for each additional tag +for tag in `git tag -l --points-at HEAD`; do + docker tag $IMAGE_NAME ${repoName}:${tag} + docker push ${repoName}:${tag} +done \ No newline at end of file