File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed
Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -2,26 +2,22 @@ FROM golang:1.23-bullseye AS deps
22
33WORKDIR /app
44COPY go.mod go.sum ./
5- RUN --mount=type=cache,target=/go/pkg/mod \
6- go mod download
5+ RUN go mod download
76
87FROM golang:1.23-bullseye AS build
98
109WORKDIR /app
1110COPY --from=deps /go/pkg/mod /go/pkg/mod
1211COPY . .
13- RUN --mount=type=cache,target=/var/cache/apt \
14- apt-get update && apt-get install -y gcc g++
12+ RUN apt-get update && apt-get install -y gcc g++
1513ENV CGO_ENABLED=1 \
1614 GOOS=linux \
1715 GOARCH=amd64
1816
19- RUN --mount=type=cache,target=/root/.cache/go-build \
20- go build -o /app/bin/sentinel ./
17+ RUN go build -o /app/bin/sentinel ./
2118
2219FROM debian:bullseye-slim
23- RUN --mount=type=cache,target=/var/cache/apt \
24- apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
20+ RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
2521ENV GIN_MODE=release
2622COPY --from=build /app/ /app
2723COPY --from=build /app/bin/sentinel /app/sentinel
Original file line number Diff line number Diff line change @@ -2,26 +2,22 @@ FROM golang:1.23-bullseye AS deps
22
33WORKDIR /app
44COPY go.mod go.sum ./
5- RUN --mount=type=cache,target=/go/pkg/mod \
6- go mod download
5+ RUN go mod download
76
87FROM golang:1.23-bullseye AS build
98
109WORKDIR /app
1110COPY --from=deps /go/pkg/mod /go/pkg/mod
1211COPY . .
13- RUN --mount=type=cache,target=/var/cache/apt \
14- apt-get update && apt-get install -y gcc g++
12+ RUN apt-get update && apt-get install -y gcc g++
1513ENV CGO_ENABLED=1 \
1614 GOOS=linux \
1715 GOARCH=arm64
1816
19- RUN --mount=type=cache,target=/root/.cache/go-build \
20- go build -o /app/bin/sentinel ./
17+ RUN go build -o /app/bin/sentinel ./
2118
2219FROM debian:bullseye-slim
23- RUN --mount=type=cache,target=/var/cache/apt \
24- apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
20+ RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
2521ENV GIN_MODE=release
2622COPY --from=build /app/ /app
2723COPY --from=build /app/bin/sentinel /app/sentinel
You can’t perform that action at this time.
0 commit comments