forked from jgsqware/clairctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (46 loc) · 1.63 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
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 --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/jgsqware/clairctl/archive/${CLAIRCTL_VERSION}.zip -o clairctl.zip \
&& mkdir -p ${GOPATH}/src/github.com/jgsqware/ \
&& unzip clairctl.zip -d ${GOPATH}/src/github.com/jgsqware/ \
&& rm -f clairctl.zip \
&& mv ${GOPATH}/src/github.com/jgsqware/clairctl-* ${GOPATH}/src/github.com/jgsqware/clairctl \
&& cd ${GOPATH}/src/github.com/jgsqware/clairctl \
&& glide install -v \
&& go generate ./clair \
&& go build -o /usr/local/bin/clairctl -ldflags "-X github.com/jgsqware/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\n\
priority: Low\n\
report:\n\
path: /reports\n\
format: html\n\
clairctl:\n\
port: 44480\n\
tempfolder: /tmp'\
> /home/clairctl/clairctl.yml
USER clairctl
WORKDIR /home/clairctl/
EXPOSE 44480
VOLUME ["/tmp/", "/reports/"]
CMD ["/usr/sbin/crond", "-f"]