-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (25 loc) · 1.06 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
FROM mcr.microsoft.com/dotnet/sdk:5.0
# GoCD agent needs the jdk and git/svn/mercurial...
RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg git software-properties-common \
&& rm -rf /var/lib/apt/lists/*
RUN wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
RUN add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
RUN apt-get update \
&& apt-get install -y --no-install-recommends adoptopenjdk-13-hotspot \
&& rm -rf /var/lib/apt/lists/*
# Add a user to run the go agent
RUN addgroup go
RUN adduser go --ingroup go --home /go --disabled-password --system
# download tini to ensure that an init process exists
ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# ensure that the container logs on stdout
ADD log4j.properties /go/log4j.properties
ADD log4j.properties /go/go-agent-log4j.properties
ADD go-agent /go-agent
RUN chmod 755 /go-agent
# Run the bootstrapper as the `go` user
USER go
CMD /go-agent