-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (44 loc) · 993 Bytes
/
Copy pathDockerfile
File metadata and controls
48 lines (44 loc) · 993 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
39
40
41
42
43
44
45
46
47
48
# base image
FROM golang:1.25.1-alpine AS base
ENV CGO_ENABLED=0
WORKDIR /build
COPY ./agb .
RUN go mod download && go generate ./...
# linter
FROM golangci/golangci-lint:v2.5-alpine AS lint
ENV CGO_ENABLED=0
WORKDIR /src
COPY --from=base /build .
COPY ./agb/.golangci.yaml .
RUN go mod download && golangci-lint run --timeout 5m
# binary build
FROM base AS build
WORKDIR /build
COPY --from=lint /src/lint_report.json .
RUN ls .
RUN go test ./... && go build -o /build/agb ./cmd/agb
# final image
FROM debian:bookworm-slim
WORKDIR /app
COPY --from=build /build/agb ./agb
ADD https://storage.googleapis.com/git-repo-downloads/repo /usr/local/bin/
RUN chmod -R 755 /usr/local/bin/repo
RUN \
apt-get update \
&& \
apt-get install -y \
curl \
wget \
git \
gcc \
g++ \
libssl-dev \
python3 \
python3-pip \
make \
zip \
bc \
libgpgme-dev \
bison \
flex
CMD [ "/bin/sh" ]