-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
42 lines (30 loc) · 976 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
#########################################
# Build stage
#########################################
FROM golang:1.21 AS builder
# Repository location
ARG REPOSITORY=github.com/ncarlier
# Artifact name
ARG ARTIFACT=feedpushr
# Copy sources into the container
ADD . /go/src/$REPOSITORY/$ARTIFACT
# Set working directory
WORKDIR /go/src/$REPOSITORY/$ARTIFACT
# Build the binary
RUN make build plugins
#########################################
# Distribution stage
#########################################
FROM gcr.io/distroless/base-debian12
# Repository location
ARG REPOSITORY=github.com/ncarlier
# Artifact name
ARG ARTIFACT=feedpushr
# Install project files
COPY --from=builder /go/src/$REPOSITORY/$ARTIFACT/release/ /usr/local/share/$ARTIFACT/
# Install binary
COPY --from=builder /go/src/$REPOSITORY/$ARTIFACT/release/$ARTIFACT /usr/local/bin/$ARTIFACT
# Define working directory
WORKDIR /usr/local/share/$ARTIFACT
# Define entrypoint
ENTRYPOINT [ "feedpushr" ]