-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 996 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (25 loc) · 996 Bytes
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
# syntax = docker/dockerfile:1.2.1
# Start from the latest golang base image
FROM public.ecr.aws/docker/library/golang:1.25.5-bookworm@sha256:019c22232e57fda8ded2b10a8f201989e839f3d3f962d4931375069bbb927e03 as builder
# Set the Current Working Directory inside the container
WORKDIR /app
# Copy everything from the current directory to the Working Directory inside the container
COPY . .
WORKDIR /app
ARG VERSION=dev
ARG REVISION=unknown
ENV VERSION ${VERSION}
ENV REVISION ${REVISION}
# Build the Go app
RUN make build
######## Start a new stage from scratch #######
FROM public.ecr.aws/bitnami/minideb:bullseye@sha256:a6f3a96622f1a2e0eb049e08e3aa4db29c725318c7f410a050f333e074793e88
RUN install_packages ca-certificates && \
update-ca-certificates
WORKDIR /app
# Copy the Pre-built binary file from the previous stage
COPY --from=builder /app/bin/ .
# ensure that we'll not be running the container as root
USER 1001:1001
# Command to run the executable
ENTRYPOINT ["./main"]