forked from digitalocean/do-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (30 loc) · 907 Bytes
/
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 golang:1.11-alpine
ENV CGO=0
ENV GOOS=linux
ARG CURRENT_BRANCH
ARG CURRENT_HASH
ARG LAST_RELEASE
RUN apk update && \
apk add bash && \
apk add curl && \
apk add git && \
apk add make && \
apk add libc6-compat
COPY . /go/src/github.com/digitalocean/do-agent
RUN cd /go/src/github.com/digitalocean/do-agent && \
set -x && \
make build RELEASE=${LAST_RELEASE} CURRENT_BRANCH=${CURRENT_BRANCH} CURRENT_HASH=${CURRENT_HASH}
# Copy what is needed to
FROM alpine
ENV DO_AGENT_REPO_PATH /agent/updates
ENV DO_AGENT_PROCFS_ROOT /agent/proc
RUN mkdir -p /agent
RUN mkdir -p /agent/updates
RUN mkdir -p /agent/proc
RUN apk update && \
apk add libc6-compat && \
apk add ca-certificates && \
rm -rf /var/cache/apk/*
COPY --from=0 /go/src/github.com/digitalocean/do-agent/build/do-agent_linux_amd64 /agent
RUN find /agent
CMD /agent/do-agent_linux_amd64