This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (33 loc) · 1.96 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM jenkins/jenkins:lts-alpine
# Install plugins, if they aren't already
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
# Suppress plugin install banner
RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
# Installing packages, need to be root to do so
USER root
# We need docker tools, make and ssl support for wget
ENV DOCKER_COMPOSE_VERSION 1.25.4
ENV PACKAGES "ca-certificates docker make openssl docker-compose~=${DOCKER_COMPOSE_VERSION}"
RUN apk add --no-cache --update $PACKAGES
# Download and install Rancher CLI
ENV RANCHER_CLI_VERSION 0.6.13
# The rancher tar.gz includes permissions data for the "current" folder, so don't extract to the root of /tmp since it will change the permissions :-(
RUN mkdir /tmp/rancher \
&& wget -qO- https://github.com/rancher/cli/releases/download/v${RANCHER_CLI_VERSION}/rancher-linux-amd64-v${RANCHER_CLI_VERSION}.tar.gz \
| tar xvz -C /tmp/rancher \
&& mv /tmp/rancher/rancher-v${RANCHER_CLI_VERSION}/rancher /usr/local/bin/rancher \
&& chmod +x /usr/local/bin/rancher \
&& rm -r /tmp/rancher
# Download and install Rancher Compose
ENV RANCHER_COMPOSE_VERSION 0.12.5
# The rancher tar.gz includes permissions data for the "current" folder, so don't extract to the root of /tmp since it will change the permissions :-(
RUN mkdir /tmp/rancher-compose \
&& wget -qO- https://github.com/rancher/rancher-compose/releases/download/v${RANCHER_COMPOSE_VERSION}/rancher-compose-linux-amd64-v${RANCHER_COMPOSE_VERSION}.tar.gz \
| tar xvz -C /tmp/rancher-compose \
&& mv /tmp/rancher-compose/rancher-compose-v${RANCHER_COMPOSE_VERSION}/rancher-compose /usr/local/bin/rancher-compose \
&& chmod +x /usr/local/bin/rancher-compose \
&& rm -r /tmp/rancher-compose
# Stay as root for custom entrypoint, which will then switch back to jenkins user
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]