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

Error when builing Docker image #1158

Closed
svetasmirnova opened this issue Feb 14, 2024 · 0 comments · Fixed by #1159
Closed

Error when builing Docker image #1158

svetasmirnova opened this issue Feb 14, 2024 · 0 comments · Fixed by #1159
Assignees

Comments

@svetasmirnova
Copy link

Describe the bug

When I try to build a Docker image, I get error:

=> [build-env 6/7] RUN go mod download                                                                                                                                                              31.7s 
=> ERROR [build-env 7/7] RUN go build ./cmd/subfinder                                                                                                                                               10.4s 
------                                                                                                                                                                                                     
> [build-env 7/7] RUN go build ./cmd/subfinder:                                                                                                                                                           
8.498 # github.com/projectdiscovery/fastdialer/fastdialer/metafiles                                                                                                                                        
8.498 /go/pkg/mod/github.com/projectdiscovery/[email protected]/fastdialer/metafiles/shared.go:49:21: undefined: sync.OnceFunc                                                                            
8.498 /go/pkg/mod/github.com/projectdiscovery/[email protected]/fastdialer/metafiles/shared.go:73:19: undefined: sync.OnceFunc
8.498 note: module requires Go 1.21
------
Dockerfile:8
--------------------
  6 |     WORKDIR /app/v2
  7 |     RUN go mod download
  8 | >>> RUN go build ./cmd/subfinder
  9 |     
 10 |     # Release
--------------------
ERROR: failed to solve: process "/bin/sh -c go build ./cmd/subfinder" did not complete successfully: exit code: 1

After changing Dockerfile as

$ git diff
diff --git a/Dockerfile b/Dockerfile
index 3d5f71f..99c6783 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
 # Build
-FROM golang:1.20.6-alpine AS build-env
+FROM golang:1.21-alpine AS build-env

The docker image compiles fine.

Subfinder version

$ docker run subfinder -version
[INF] Current Version: v2.6.5
[INF] Subfinder Config Directory: /root/.config/subfinder

Complete command you used to reproduce this
docker build -t subfinder .

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

Successfully merging a pull request may close this issue.

2 participants