-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile.release
More file actions
38 lines (27 loc) · 995 Bytes
/
Dockerfile.release
File metadata and controls
38 lines (27 loc) · 995 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
# Multi-architecture Dockerfile that uses pre-built binaries.
# This Dockerfile expects binaries to be built beforehand using:
# $ make release_build_cross
FROM alpine:3.19 AS final
# Create non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
# Set working directory
WORKDIR /app
# Add runtime dependencies and prepare directories
RUN apk add --no-cache ca-certificates tzdata && \
mkdir -p /app/config && \
chown -R appuser:appgroup /app
ARG IMAGE_TAG
ENV IMAGE_TAG=${IMAGE_TAG}
# Optional suffix for selecting the CGO-enabled binary variant
# Empty by default (uses CGO-disabled binary). For CGO builds, pass: _cgo
# Fore more details, see .github/workflows/main-build.yml
ARG BINARY_SUFFIX=""
# Determine the architecture and copy the appropriate binary
ARG TARGETARCH
COPY release/path-linux-${TARGETARCH}${BINARY_SUFFIX} /app/path
# Set the binary as executable
RUN chmod +x /app/path
# Use non-root user
USER appuser
# Command to run
CMD ["./path"]