This repository was archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 1.32 KB
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
# syntax = docker.mirror.hashicorp.services/docker/dockerfile:experimental
FROM docker.mirror.hashicorp.services/golang:alpine AS builder
RUN apk add --no-cache git gcc libc-dev openssh
RUN mkdir -p /tmp/prime
COPY go.sum /tmp/prime
COPY go.mod /tmp/prime
WORKDIR /tmp/prime
RUN mkdir -p -m 0600 ~/.ssh \
&& ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
RUN git config --global url.ssh://git@github.com/.insteadOf https://github.com/
RUN --mount=type=ssh --mount=type=secret,id=ssh.config --mount=type=secret,id=ssh.key \
GIT_SSH_COMMAND="ssh -o \"ControlMaster auto\" -F \"/run/secrets/ssh.config\"" \
GOPRIVATE=github.com/hashicorp \
go mod download
COPY . /tmp/src
WORKDIR /tmp/src
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=ssh go build -o /tmp/waypoint-hzn -ldflags "-X main.sha1ver=`git rev-parse HEAD` -X main.buildTime=$(date +'+%FT%T.%N%:z')" ./cmd/waypoint-hzn
FROM docker.mirror.hashicorp.services/alpine
COPY --from=builder /tmp/waypoint-hzn /usr/bin/waypoint-hzn
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.2 && \
wget -qO/usr/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /usr/bin/grpc_health_probe
COPY ./migrations /migrations
ENTRYPOINT ["/usr/bin/waypoint-hzn"]