-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (23 loc) · 909 Bytes
/
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
# Stage 1: Build the Go application
FROM golang:1.22.9@sha256:147f428a24c6b80b8afbdaec7f245b9e7ac342601e3aeaffb321a103b7c6b3f4
# Set the working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files to the working directory
COPY go.mod go.sum ./
# Download and install dependencies
RUN go mod download
# Copy the rest of the application code to the working directory
COPY . .
# Build the Go application
RUN go build -o vault-backup-validator . && \
apt-get update && \
apt-get install -y --no-install-recommends unzip jq && \
rm -rf /var/lib/apt/lists/*
#Download and install Vault
ADD https://releases.hashicorp.com/vault/1.14.0/vault_1.14.0_linux_amd64.zip /tmp/vault.zip
# Unzip the Vault binary and clean up
RUN unzip /tmp/vault.zip -d /usr/local/bin/ && \
rm /tmp/vault.zip
EXPOSE 8080
# Start the application as root
CMD ["/app/vault-backup-validator"]