forked from mozilla/tls-observatory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (51 loc) · 2.18 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
# docker build --force-rm --squash -t {REPO}/{NAME}:{TAG} .
# --squash requires the expermimental flag to be set.
# https://docs.docker.com/engine/reference/commandline/dockerd/#description
#
# This is based on the original Golang Dockerfile for Debian Stretch
# https://github.com/docker-library/golang/blob/906e04de73168f643c5c2b40dca0877a14d2377c/1.10/stretch/Dockerfile
FROM golang:1.15
MAINTAINER [email protected]
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
WORKDIR $GOPATH
COPY . $GOPATH/src/github.com/mozilla/tls-observatory
RUN rm -rf $GOPATH/src/github.com/mozilla/tls-observatory/.git && \
# Create a user
addgroup -gid 10001 app && \
adduser --home /app --gecos "" --ingroup=app --uid=10001 --disabled-login app
# Build TLS Observatory
RUN go install github.com/mozilla/tls-observatory/tlsobs-api && \
cp $GOPATH/bin/tlsobs-api /app/ && \
go install github.com/mozilla/tls-observatory/tlsobs-scanner && \
cp $GOPATH/bin/tlsobs-scanner /app/ && \
go install github.com/mozilla/tls-observatory/tlsobs-runner && \
cp $GOPATH/bin/tlsobs-runner /app/ && \
go install github.com/mozilla/tls-observatory/tlsobs && \
cp $GOPATH/bin/tlsobs /app/
# Compile ev-checker
RUN cd $GOPATH && \
apt-get update -y && \
apt-get --no-install-recommends install apt-utils ca-certificates git libcurl4-nss-dev \
libnss3 libnss3-dev clang postgresql-client ruby ruby-dev -y && \
chown app:app -R /var/lib/gems/ && \
git clone https://github.com/mozilla-services/ev-checker.git && \
cd ev-checker && \
make && \
mv ./ev-checker /go/bin/ && \
cp $GOPATH/bin/ev-checker /app/ && \
cd .. && \
rm -rf ev-checker
# Compile AWS Certlint
RUN cd $GOPATH && \
git clone https://github.com/awslabs/certlint.git && \
cd certlint/ext && \
gem install public_suffix simpleidn && \
ruby extconf.rb && \
make
# Copy TLS Observatory configuration
RUN cp $GOPATH/src/github.com/mozilla/tls-observatory/version.json /app && \
ln -s $GOPATH/src/github.com/mozilla/tls-observatory/conf /etc/tls-observatory && \
ln -s $GOPATH/src/github.com/mozilla/tls-observatory/cipherscan /opt/cipherscan
WORKDIR /app
USER app