Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in docker build? #362

Open
AravindHemachandran opened this issue Nov 16, 2023 · 2 comments
Open

Issue in docker build? #362

AravindHemachandran opened this issue Nov 16, 2023 · 2 comments

Comments

@AravindHemachandran
Copy link

Hi,

When running the docker build cmd
docker build -t talaria:v0.7.7 -f Dockerfile .

I am getting the following error

[+] Building 4.1s (13/20)                                                                                                              docker:default
 => [internal] load build definition from Dockerfile                                                                                             0.1s
 => => transferring dockerfile: 1.55kB                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                0.1s
 => => transferring context: 60B                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/golang:1.19-alpine                                                                            3.6s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                 3.4s
 => CANCELED [builder 1/5] FROM docker.io/library/golang:1.19-alpine@sha256:0ec0646e208ea58e5d29e558e39f2e59fccf39b7bda306cb53bbaff91919eca5     0.3s
 => => resolve docker.io/library/golang:1.19-alpine@sha256:0ec0646e208ea58e5d29e558e39f2e59fccf39b7bda306cb53bbaff91919eca5                      0.1s
 => => sha256:0ec0646e208ea58e5d29e558e39f2e59fccf39b7bda306cb53bbaff91919eca5 1.65kB / 1.65kB                                                   0.0s
 => => sha256:276692412aea6f9dd6cdc5725b2f1c05bef8df7223811afbc6aa16294e2903f9 1.16kB / 1.16kB                                                   0.0s
 => => sha256:5da886f1a5e71f657d8205d2b8aec7c3de24070327553634520503326e53ae14 5.18kB / 5.18kB                                                   0.0s
 => CANCELED [stage-1  1/10] FROM docker.io/library/alpine:latest@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978        0.3s
 => => resolve docker.io/library/alpine:latest@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978                           0.1s
 => => sha256:48d9183eb12a05c99bcc0bf44a003607b8e941e1d4f41f9ad12bdcc4b5672f86 528B / 528B                                                       0.0s
 => => sha256:8ca4688f4f356596b5ae539337c9941abc78eda10021d35cbc52659c74d9b443 1.47kB / 1.47kB                                                   0.0s
 => => sha256:96526aa774ef0126ad0fe9e9a95764c5fc37f409ab9e97021e7b4775d82bf6fa 0B / 3.40MB                                                       0.2s
 => => sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978 1.64kB / 1.64kB                                                   0.0s
 => [internal] load build context                                                                                                                0.1s
 => => transferring context: 582.66kB                                                                                                            0.0s
 => CACHED [builder 2/5] WORKDIR /src                                                                                                            0.0s
 => CACHED [builder 3/5] RUN apk add --no-cache --no-progress     ca-certificates     curl                                                       0.0s
 => CACHED [builder 4/5] RUN mkdir -p /go/bin &&     arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) &&     curl -L -o /go/bin/spruce  0.0s
 => CACHED [builder 5/5] COPY . .                                                                                                                0.0s
 => CACHED [stage-1  2/10] COPY --from=builder /etc/ssl/certs/ca-certificates.crt  /etc/ssl/certs/                                               0.0s
 => ERROR [stage-1  3/10] COPY talaria /                                                                                                         0.0s
------
 > [stage-1  3/10] COPY talaria /:
------
Dockerfile:29
--------------------
  27 |     # Copy over the standard things you'd expect.
  28 |     COPY --from=builder /etc/ssl/certs/ca-certificates.crt  /etc/ssl/certs/
  29 | >>> COPY talaria /
  30 |     COPY ./.release/docker/entrypoint.sh  /
  31 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c048ceea-011c-4f0f-a869-1c082e011df7::wt2h6fjfysh040gge41vyk74z: "/talaria": not found

On inspecting the Dockerfile, I found out that the go build stage for talaria is missing. Earlier versions of talaria used builder docker to run the go build command and get the talaria binary which will be copied to the final alpine image. But in the latest release version 0.7.7, the Dockerfile no longer performs the go build step and Makefile is also missing.

  1. How are you making the go build?

  2. If go build is to be run in the builder stage, the builder docker version of golang which is at 1.19 has to be updated to 1.21 to support the go version in go.mod?

@schmidtw
Copy link
Member

Docker locked us out quite a while back so we have moved publishing all docker images to github hosting as part of the Packages.

We are using goreleaser to perform the build through a shared reusable workflow here

If you want to duplicate the release process you can manually copy the .gorelease.yml file from this step in the build process.

@AravindHemachandran
Copy link
Author

Thanks for the clarification. I am new to the goreleaser tool. While going through ci.yml file, it shows you are using the latest version of go to build the talaria binary. I think that clears my doubt regarding question 2.

Since go build is handled separately, is there a need for builder docker in Dockerfile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants