Skip to content

Commit a33b929

Browse files
committed
fix(deps): 🗃️ docker build - failed to solve failed to compute cache key
1 parent 6d25955 commit a33b929

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

build/Dockerfile

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
FROM golang:1.24-bookworm as builder
1+
FROM golang:1.24-bookworm AS builder
22

3-
WORKDIR /ctf01d.ru
3+
WORKDIR /app
44

5-
COPY ./go.mod ./
6-
COPY ./go.sum ./
5+
COPY go.mod go.sum ./
6+
RUN go mod download
77

8-
RUN go mod tidy
9-
10-
COPY ./ ./
8+
COPY . .
119

1210
ARG VERSION
1311
ARG BUILDTIME
14-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'ctf01d/internal/handler.version=${VERSION}' -X ctf01d/internal/handler.buildTime=${BUILDTIME}" -o server cmd/main.go
12+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'ctf01d/internal/handler.version=${VERSION}' -X 'ctf01d/internal/handler.buildTime=${BUILDTIME}'" -o server ./cmd/main.go
1513

16-
FROM alpine:latest as prod
17-
LABEL "maintainer"="Evgenii Sopov <mrseakg@gmail.com>"
18-
LABEL "repository"="https://github.com/sea5kg/ctf01d-training-platform"
14+
FROM alpine:latest AS prod
15+
LABEL maintainer="Evgenii Sopov <mrseakg@gmail.com>"
16+
LABEL repository="https://github.com/sea5kg/ctf01d-training-platform"
1917
RUN apk --no-cache add ca-certificates
2018

21-
WORKDIR /ctf01d.ru
22-
23-
COPY --from=builder /ctf01d.ru/server .
24-
COPY --from=builder /ctf01d.ru/configs/ ./configs/
25-
COPY --from=builder /ctf01d.ru/html/ ./html/
19+
WORKDIR /app
20+
COPY --from=builder /app/server .
21+
COPY --from=builder /app/configs ./configs
22+
COPY --from=builder /app/html ./html
2623

2724
EXPOSE 4102
2825

0 commit comments

Comments
 (0)