This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
81 lines (63 loc) · 3.26 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright 2020 ThoughtWorks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################################
# This file is autogenerated by the repository at https://github.com/gocd/gocd.
# Please file any issues or PRs at https://github.com/gocd/gocd
###############################################################################################
FROM alpine:latest as gocd-agent-unzip
ARG UID=1000
RUN \
apk --no-cache upgrade && \
apk add --no-cache curl && \
curl --fail --location --silent --show-error "https://download.gocd.org/binaries/20.5.0-11820/generic/go-agent-20.5.0-11820.zip" > /tmp/go-agent-20.5.0-11820.zip
RUN unzip /tmp/go-agent-20.5.0-11820.zip -d /
RUN mv /go-agent-20.5.0 /go-agent && chown -R ${UID}:0 /go-agent && chmod -R g=u /go-agent
FROM debian:jessie
LABEL gocd.version="20.5.0" \
description="GoCD agent based on debian version 8" \
maintainer="ThoughtWorks, Inc. <support@thoughtworks.com>" \
url="https://www.gocd.org" \
gocd.full.version="20.5.0-11820" \
gocd.git.sha="1c9b12ac8aa216a2c062fbec4cba18d9cfb8b404"
ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini-static-amd64 /usr/local/sbin/tini
# force encoding
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
ENV GO_JAVA_HOME="/gocd-jre"
ARG UID=1000
ARG GID=1000
RUN \
# add mode and permissions for files we added above
chmod 0755 /usr/local/sbin/tini && \
chown root:root /usr/local/sbin/tini && \
# add our user and group first to make sure their IDs get assigned consistently,
# regardless of whatever dependencies get added
# add user to root group for gocd to work on openshift
useradd -u ${UID} -g root -d /home/go -m go && \
apt-get update && \
apt-get install -y git subversion mercurial openssh-client bash unzip curl locales procps sysvinit-utils coreutils && \
apt-get autoclean && \
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && /usr/sbin/locale-gen && \
curl --fail --location --silent --show-error 'https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jre_x64_linux_hotspot_13.0.2_8.tar.gz' --output /tmp/jre.tar.gz && \
mkdir -p /gocd-jre && \
tar -xf /tmp/jre.tar.gz -C /gocd-jre --strip 1 && \
rm -rf /tmp/jre.tar.gz && \
mkdir -p /go-agent /docker-entrypoint.d /go /godata
ADD docker-entrypoint.sh /
COPY --from=gocd-agent-unzip /go-agent /go-agent
# ensure that logs are printed to console output
COPY --chown=go:root agent-bootstrapper-logback-include.xml agent-launcher-logback-include.xml agent-logback-include.xml /go-agent/config/
RUN chown -R go:root /docker-entrypoint.d /go /godata /docker-entrypoint.sh \
&& chmod -R g=u /docker-entrypoint.d /go /godata /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
USER go