This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
55 lines (53 loc) · 2.09 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
# syntax=docker/dockerfile:1.0-experimental
FROM golang:1.13 AS dev
ENV HOME /root
ENV GOPATH /usr
# enable GOMODULES
ENV GO111MODULE on
ENV CGO_ENABLED 0
# Nice to haves for development
RUN apt-get update && apt-get install -y iputils-ping vim
# Install protoc-gen-go
RUN go get -u github.com/golang/protobuf/[email protected]
# Install protobuf compiler
RUN apt-get install -y unzip
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protoc-3.7.0-linux-x86_64.zip
RUN unzip protoc-3.7.0-linux-x86_64.zip -d protoc3
RUN mv protoc3/bin/* /usr/local/bin/
RUN mv protoc3/include/* /usr/local/include/
# Install Vault CLI for ease of testing Vault out
RUN wget https://releases.hashicorp.com/vault/1.4.2/vault_1.4.2_linux_amd64.zip
RUN unzip vault_1.4.2_linux_amd64.zip
RUN mv vault /usr/local/bin/
# Intall AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install
RUN apt-get install -y \
build-essential \
libpq-dev \
python3.7 \
python3.7-dev \
python3-pip \
python3-venv
RUN pip3 install poetry tox
WORKDIR /usr/src/approzium/sdk/python
COPY sdk/python .
RUN poetry run pip install -U pip setuptools
RUN poetry install --extras "sqllibs tracing"
# Build Authenticator Go Binary
WORKDIR /usr/src/approzium/authenticator
COPY authenticator/ .
RUN --mount=type=cache,target=$GOPATH/pkg/mod go build
FROM alpine:latest AS authenticator-build
WORKDIR /app/
COPY --from=dev /usr/src/approzium/authenticator/authenticator .
ENTRYPOINT ["./authenticator"]
FROM authenticator-build AS authenticator-dev
COPY --from=dev /usr/src/approzium/authenticator/server/testing/approzium.pem .
RUN chmod 644 /app/approzium.pem
COPY --from=dev /usr/src/approzium/authenticator/server/testing/approzium.key .
RUN chmod 644 /app/approzium.key
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
COPY --from=dev /usr/src/approzium/authenticator/server/testing/ca.cert /usr/local/share/ca-certificates/self-signed-ca.cert
RUN chmod 644 /usr/local/share/ca-certificates/self-signed-ca.cert && update-ca-certificates