-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (51 loc) · 1.79 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
FROM alpine:3.5
ENV GOPATH=/go
ENV PATH=${GOPATH}/bin:${PATH}
ENV DOCKER_API_VERSION=1.24
ARG DOCKER_VERSION=${DOCKER_VERSION:-latest}
ARG CLAIRCTL_VERSION=${CLAIRCTL_VERSION:-master}
ARG CLAIRCTL_COMMIT=
RUN apk add --update curl \
&& apk add --update --virtual build-dependencies go gcc build-base glide git \
&& adduser clairctl -D \
&& mkdir -p /reports \
&& chown -R clairctl:clairctl /reports /tmp \
&& curl https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz -o docker.tgz \
&& tar xfvz docker.tgz --strip 1 -C /usr/bin/ docker/docker \
&& rm -f docker.tgz \
&& go get -u github.com/jteeuwen/go-bindata/... \
#&& curl -sL https://github.com/ids/clairctl/archive/${CLAIRCTL_VERSION}.zip -o clairctl.zip \
&& mkdir -p ${GOPATH}/src/github.com/ids/
#&& unzip clairctl.zip -d ${GOPATH}/src/github.com/ids/ \
#&& rm -f clairctl.zip \
#&& mv ${GOPATH}/src/github.com/ids/clairctl-* ${GOPATH}/src/github.com/ids/clairctl \
COPY ./ /tmp/clairctl
RUN mv /tmp/clairctl ${GOPATH}/src/github.com/ids/clairctl \
&& cd ${GOPATH}/src/github.com/ids/clairctl \
&& glide install -v \
&& go generate ./clair \
&& go build -o /usr/local/bin/clairctl -ldflags "-X github.com/ids/clairctl/cmd.version=${CLAIRCTL_VERSION}-${CLAIRCTL_COMMIT}" \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/* \
&& rm -rf /root/.glide/ \
&& rm -rf /go \
&& echo $'clair:\n\
port: 6060\n\
healthPort: 6061\n\
uri: http://clair-api\n\
priority: Low\n\
report:\n\
path: /reports\n\
format: html\n\
clairctl:\n\
port: 44480\n\
tempfolder: /tmp'\
> /home/clairctl/clairctl.yml
RUN apk upgrade git
RUN apk upgrade bin-utils
USER clairctl
COPY ./clair-config.yml /config/config.yml
WORKDIR /home/clairctl/
EXPOSE 44480
VOLUME ["/tmp/", "/reports/"]
CMD ["/usr/sbin/crond", "-f"]