cameradar: Build failure: `curl version is too low`
Hy…
I when getting image from dockerfile clone source code github
The program encounters the following problem
Context
Please select one:
- [ ✅ ] I use my own build of the docker image
Please select one:
- [ ✅ ] I use the latest commit of the master branch
Environment
My operating system:
- [ ✅ ] Linux
OS version: <Ubuntu 22.10>
Issue
#0 27.23 # github.com/Ullaakut/go-curl #0 27.23 In file included from /go/pkg/mod/github.com/!ullaakut/go-curl@v0.0.0-20190525093431-597e157bbffd/const.go:5: #0 27.23 ./compat.h:423:2: error: #error your version is TOOOOOOOO low #0 27.23 423 | #error your version is TOOOOOOOO low #0 27.23 | ^~~~~
What was expected
<expected behavior>What happened
when clone project from github and builde dockerfile without changing the source code dockerfile <observed behavior>
Logs
sudo docker build -t test:001 .
...
#0 15.33 go: downloading golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
#0 15.40 go: downloading golang.org/x/text v0.3.0
#0 15.40 go: downloading github.com/fatih/color v1.7.0
#0 17.12 go: downloading github.com/mattn/go-isatty v0.0.8
#0 17.12 go: downloading github.com/mattn/go-colorable v0.1.2
#0 27.23 # github.com/Ullaakut/go-curl
#0 27.23 In file included from /go/pkg/mod/github.com/!ullaakut/go-curl@v0.0.0-20190525093431-597e157bbffd/const.go:5
#0 27.23 ./compat.h:423:2: error: #error your version is TOOOOOOOO low
#0 27.23 423 | #error your version is TOOOOOOOO low
#0 27.23 | ^~~~~
------
Dockerfile:17
--------------------
15 | ENV GO111MODULE=on
16 | RUN go version
17 | >>> RUN go build -o cameradar
18 |
19 | # Final stage
--------------------
ERROR: failed to solve: process "/bin/sh -c go build -o cameradar" did not complete successfully: exit code: 1
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 17 (6 by maintainers)
OK @Ullaakut It’s an incompatible version requirement between go-curl and golang version. I succeed to build with a previous version like this one : FROM golang:1.16-alpine3.13 AS build-env
Maybe we need to find the latest version that compile correctly. But this one seems to do the job. I tried really old ones that crash for some other reasons…
@dordyan I had to modify your Dockerfile source code in order to get it working for me. It will be found to be more simplistic, but running it this way allowed the achievement of a successful build, where otherwise it proved unsuccessful.
Here is a Dockerfile that allow you to get a successful build.
Don’t know how anyone would discover any similarities in potential issues with the issue labeled as ambiguously as it is. It might be a good idea to change this… just saying.
I don’t really have the time to troubleshoot a resolution to this issue at the moment, but the resolution to downgrade to
golang:1.16-alpine3.13does not sit well.As for simply replacing
Ullaakutwithandelf, it does not work. The go version designation includes a 12 character hash at the end, and how to discover the appropriate hash I do not know.I will have to look at this when I have more time.
My version of go-curl is even older than that, the main branch of andelf indeed fixes the thing I tried to fix in my fork, on top of also making further changes, so either way we should replace the dependency. However indeed, it seems like there is a problem with the curl version.
Likely what would fix it then is to change the version of libcurl that is installed in the first step of the Dockerfile:
In the last stage, we specify the version of curl we want to get a very specific one, but it looks like the build stage now fails due to the curl version that matches the package manager in the
golang:alpineimage.I can’t look into it at the moment unfortunately.
I also encountered such a problem… I feel that you are wrong, the last update of the library andelf/go-curl is 3 years ago. It means that no changes have been made in the library to correct andelf/go-curl and the problem is somewhere else
However, we will try Thank @Ullaakut
If you want to fix it, all you need to do is replace the dependency from
https://github.com/Ullaakut/go-curltohttps://github.com/andelf/go-curl. That should be enough to allow you to build the docker image.Have a good day!
### Please help me to fix this issue @Ullaakut 🙏️🙏️🙏️