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

Dockerfile does not build #502

Open
gshiba opened this issue Jan 21, 2025 · 1 comment
Open

Dockerfile does not build #502

gshiba opened this issue Jan 21, 2025 · 1 comment

Comments

@gshiba
Copy link

gshiba commented Jan 21, 2025

Error with docker build:

$ docker build -t shenwei356/seqkit .
[+] Building 3.5s (6/9)                                                                  docker:default
 => [internal] load build definition from Dockerfile                                               0.0s
 => => transferring dockerfile: 1.45kB                                                             0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                    0.3s
 => [internal] load .dockerignore                                                                  0.0s
 => => transferring context: 2B                                                                    0.0s
 => [1/6] FROM docker.io/library/ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416  0.0s
 => CACHED [2/6] RUN apt-get update && apt-get install -y --no-install-recommends         build-e  0.0s
 => ERROR [3/6] RUN curl -fsSL "https://golang.org/dl/go1.17.linux-amd64.tar.gz" -o golang.tar.gz  3.2s
------                                                                                                  
 > [3/6] RUN curl -fsSL "https://golang.org/dl/go1.17.linux-amd64.tar.gz" -o golang.tar.gz &&     echo "b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499 golang.tar.gz" | sha256sum -c - &&     sudo tar -C /usr/local -xzf golang.tar.gz &&     rm golang.tar.gz &&     mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go":
2.963 golang.tar.gz: FAILED
2.963 sha256sum: WARNING: 1 computed checksum did NOT match
------
Dockerfile:32
--------------------
  31 |     ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
  32 | >>> RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \
  33 | >>>     echo "$GOLANG_SHA256_CHECKSUM golang.tar.gz" | sha256sum -c - && \
  34 | >>>     sudo tar -C /usr/local -xzf golang.tar.gz && \
  35 | >>>     rm golang.tar.gz && \
  36 | >>>     mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
  37 |     #End: install golang
--------------------
ERROR: failed to solve: process "/bin/sh -c curl -fsSL \"$GOLANG_DOWNLOAD_URL\" -o golang.tar.gz &&     echo \"$GOLANG_SHA256_CHECKSUM golang.tar.gz\" | sha256sum -c - &&     sudo tar -C /usr/local -xzf golang.tar.gz &&     rm golang.tar.gz &&     mkdir -p \"$GOPATH/src\" \"$GOPATH/bin\" && chmod -R 777 \"$GOPATH\"" did not complete successfully: exit code: 1

I updated the checksum (from https://go.dev/dl/):

diff --git a/Dockerfile b/Dockerfile
index 43ada12..89889ed 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,8 +25,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
 
 #Begin: install golang
 ENV GOLANG_VERSION 1.17
 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
-ENV GOLANG_SHA256_CHECKSUM b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499
+ENV GOLANG_SHA256_CHECKSUM 6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d
 ENV GOPATH $HOME/go
 ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
 RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \

Then I hit another error:

$ docker build -t shenwei356/seqkit .
[+] Building 9.2s (7/9)                                                                  docker:default
 => [internal] load build definition from Dockerfile                                               0.0s
 => => transferring dockerfile: 1.45kB                                                             0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                    0.3s
 => [internal] load .dockerignore                                                                  0.0s
 => => transferring context: 2B                                                                    0.0s
 => [1/6] FROM docker.io/library/ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416  0.0s
 => CACHED [2/6] RUN apt-get update && apt-get install -y --no-install-recommends         build-e  0.0s
 => [3/6] RUN curl -fsSL "https://golang.org/dl/go1.17.linux-amd64.tar.gz" -o golang.tar.gz &&     7.4s
 => ERROR [4/6] RUN go get github.com/derekparker/delve/cmd/dlv                                    1.5s 
------                                                                                                  
 > [4/6] RUN go get github.com/derekparker/delve/cmd/dlv:                                               
0.646 go: downloading github.com/derekparker/delve v1.21.2                                              
1.169 go get: github.com/derekparker/[email protected]: parsing go.mod:                                     
1.169   module declares its path as: github.com/go-delve/delve
1.169           but was required as: github.com/derekparker/delve
------
Dockerfile:40
--------------------
  38 |     
  39 |     #Begin: install delve
  40 | >>> RUN go get github.com/derekparker/delve/cmd/dlv
  41 |     #End: install delve
  42 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c go get github.com/derekparker/delve/cmd/dlv" did not complete successfully: exit code: 1

Then I tried:

-RUN go get github.com/derekparker/delve/cmd/dlv
+RUN go get github.com/go-delve/delve/cmd/dlv

but

$ docker build -t shenwei356/seqkit .
...
1.392 go: downloading golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
1.698 github.com/go-delve/delve/cmd/dlv imports
1.698   github.com/go-delve/delve/cmd/dlv/cmds imports
1.698   github.com/go-delve/delve/pkg/proc imports
1.698   slices: package slices is not in GOROOT (/usr/local/go/src/slices)
------
Dockerfile:40
--------------------
  38 |     
  39 |     #Begin: install delve
  40 | >>> RUN go get github.com/go-delve/delve/cmd/dlv
  41 |     #End: install delve
  42 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c go get github.com/go-delve/delve/cmd/dlv" did not complete successfully: exit code: 1

... and this is as far as I could take it...

Env:

  • This is on an Amazon Linux 2023 EC2 instance.
  • docker --version # Docker version 25.0.3, build 4debf41
@shenwei356
Copy link
Owner

I'm not familiar with that, someone else contributed to it. Is there any reason you must use Docker? Can you directly download the binaries or compile from the source?

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