-
Notifications
You must be signed in to change notification settings - Fork 123
/
Dockerfile
46 lines (30 loc) · 924 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG BASE_IMAGE=docker.io/library/ubuntu:22.04
### Base
FROM $BASE_IMAGE AS base
USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN groupadd -g 999 autopilot && \
useradd -r -u 999 -g autopilot autopilot && \
mkdir -p /home/autopilot && \
chown autopilot:0 /home/autopilot && \
chmod g=u /home/autopilot && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y git tini gpg tzdata && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV USER=autopilot
USER 999
WORKDIR /home/autopilot
### Build
FROM docker.io/library/golang:1.23 AS build
WORKDIR /go/src/github.com/argoproj-labs/argocd-autopilot
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN make local DEV_MODE=false
### Run
FROM base
COPY --from=build /go/src/github.com/argoproj-labs/argocd-autopilot/dist/* /usr/local/bin/argocd-autopilot
ENTRYPOINT [ "argocd-autopilot" ]