-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 940 Bytes
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 940 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
# Build stage
FROM golang:1.23 AS builder
RUN mkdir -p /src/argocd-resource-tracker
# Set working directory
WORKDIR /src/argocd-resource-tracker
# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
RUN mkdir -p dist && \
make build
# Final runtime stage
FROM alpine:3.21
# Install necessary dependencies
RUN apk update && \
apk upgrade && \
apk add --no-cache tini
# Create necessary directories and user
RUN mkdir -p /usr/local/bin /app/config && \
adduser --home "/app" --disabled-password --uid 1000 argocd
# Copy built binary from builder stage
COPY --from=builder /src/argocd-resource-tracker/dist/argocd-resource-tracker /usr/local/bin/
COPY --from=builder /src/argocd-resource-tracker/dist/argocd-resource-tracker-operator /usr/local/bin/
# Set user permissions
USER 1000
# Set entrypoint
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-resource-tracker-operator"]