forked from stCarolas/gocd-bootstraped-agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (21 loc) · 1 KB
/
Copy pathDockerfile
File metadata and controls
27 lines (21 loc) · 1 KB
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
ARG PRIVATE_REPO=""
FROM ${PRIVATE_REPO}docker:dind
ARG GO_BOOTSTRAPPER_URL="https://github.com/ketan/gocd-golang-bootstrapper/releases/download/2.3/go-bootstrapper-2.3.linux.amd64"
ARG AGENT_TYPE="gradle"
# The directory and user that'll be used for the gocd agent process. Currently hardcoded in the bootstrapper ;-/
RUN \
addgroup -g 992 dockerroot && adduser -G dockerroot -h /go go -D \
&& apk add --no-cache openjdk8-jre-base git mercurial subversion openssh-client bash curl
# Download and ensure that the binary is executable
RUN \
curl --fail --silent --location ${GO_BOOTSTRAPPER_URL} > /go-agent && \
chmod 755 /go-agent
ADD data/ /data/
ADD configs/ /configs/
ADD bootstrap.d/ /bootstrap.d/
RUN chmod -R 777 /bootstrap.d/ && \
PATH=$PATH:/bootstrap.d/ && \
for file in $(cat /configs/${AGENT_TYPE}); do echo "Start runnig $file:" && "$file" && echo "End running $file"; done
# execute the binary, preferably as the `go` user
USER go
CMD export GO_EA_SSL_NO_VERIFY=true && /go-agent