forked from jgsqware/clairctl
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocalDockerfile
58 lines (47 loc) · 1.95 KB
/
LocalDockerfile
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
FROM alpine:3.5
# Purpose: LocalDockerfile - allows building the clairctl from the local source files if you have cloned the project.
# Dockerfile - downloads the source from github.com as a tar file and builds the clairctl via that source.
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 mkdir -p ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl/
COPY clairctl.zip ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl/clairctl.zip
RUN unzip ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl/clairctl.zip -d ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl/ \
&& rm ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl/clairctl.zip
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/... \
&& cd ${GOPATH}/src/github.com/ContinuousSecurityTooling/clairctl \
&& glide install -v \
&& go generate ./clair \
&& go build -o /usr/local/bin/clairctl -ldflags "-X github.com/ContinuousSecurityTooling/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"]