docker.io/library/golang:1.18-bookworm: not found

I’m trying to fly launch a new Golang application. However, building failed with the following error:

==> Building image with Docker
--> docker host: 24.0.7 linux x86_64
[+] Building 2.6s (4/4) FINISHED                                                                                                 
 => [internal] load .dockerignore                                                                                           0.2s
 => => transferring context: 104B                                                                                           0.2s
 => [internal] load build definition from Dockerfile                                                                        0.2s
 => => transferring dockerfile: 307B                                                                                        0.2s
 => [internal] load metadata for docker.io/library/debian:bookworm                                                          1.4s
 => ERROR [internal] load metadata for docker.io/library/golang:1.18-bookworm                                               2.4s
------
 > [internal] load metadata for docker.io/library/golang:1.18-bookworm:
------
Error: failed to fetch an image or build from source: error building: failed to solve: golang:1.18-bookworm: docker.io/library/golang:1.18-bookworm: not found

Dockerfile is the following (generated automatically):

ARG GO_VERSION=1
FROM golang:${GO_VERSION}-bookworm as builder

WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /run-app .


FROM debian:bookworm

COPY --from=builder /run-app /usr/local/bin/
CMD ["run-app"]

My flyctl version is v0.2.59.

Replace the word “bookworm” with “bullseye” (twice) or upgrade to a newer version of go.

bookworm is a newer version of debian, 1.18 is an older version of go.

You can explore available combinations of images here:

https://hub.docker.com/_/golang/tags?page=&page_size=&ordering=&name=1.18

1 Like