mirror of
https://github.com/EpicMorg/docker-scripts.git
synced 2024-12-25 14:15:38 +03:00
jira
jira
This commit is contained in:
parent
5e99188794
commit
5bd53785c2
1
jira/.docker-repository.yml
Normal file
1
jira/.docker-repository.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
repository: epicmorg/jira
|
3
jira/.dockerignore
Normal file
3
jira/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
scripts
|
||||||
|
.idea
|
43
jira/Dockerfile
Normal file
43
jira/Dockerfile
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
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 and Synchrony ports
|
||||||
|
EXPOSE 8090
|
||||||
|
EXPOSE 8091
|
||||||
|
|
||||||
|
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.12.1
|
||||||
|
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} -Dconfluence.home=\${JIRA_HOME}/g' ${JIRA_INSTALL_DIR}/bin/setenv.sh \
|
||||||
|
&& sed -i -e 's/port="8090"/port="8090" secure="${catalinaConnectorSecure}" scheme="${catalinaConnectorScheme}" proxyName="${catalinaConnectorProxyName}" proxyPort="${catalinaConnectorProxyPort}"/' ${JIRA_INSTALL_DIR}/conf/server.xml
|
4
jira/Makefile
Normal file
4
jira/Makefile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
all: jira
|
||||||
|
|
||||||
|
jira:
|
||||||
|
docker build --no-cache -t epicmorg/jira .
|
44
jira/README.md
Normal file
44
jira/README.md
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
![Atlassian Jira Server](https://www.atlassian.com/dam/wac/legacy/jira_logo_landing.png)
|
||||||
|
|
||||||
|
|
||||||
|
## Memory / Heap Size
|
||||||
|
|
||||||
|
If you need to override Confluence 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 Confluence is run behind a reverse proxy server, then you need to specify extra options to make Confluence 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 Confluence is accessed.
|
||||||
|
|
||||||
|
* `CATALINA_CONNECTOR_SCHEME` (default: http)
|
||||||
|
|
||||||
|
The protocol via which Confluence 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 Confluence such as specifying a custom trust store, you can add them via the below environment variable
|
||||||
|
|
||||||
|
* `JVM_SUPPORT_RECOMMENDED_ARGS`
|
||||||
|
|
||||||
|
Additional JVM arguments for Confluence
|
||||||
|
|
||||||
|
|
33
jira/entrypoint.sh
Normal file
33
jira/entrypoint.sh
Normal file
@ -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-confluence.sh $@"
|
||||||
|
else
|
||||||
|
exec "$JIRA_INSTALL_DIR/bin/start-confluence.sh" "$@"
|
||||||
|
fi
|
13
jira/hooks/post_push
Normal file
13
jira/hooks/post_push
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user