-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Build release Linux binaries without cgo for Alpine compatibility? #169
Comments
Could it be that you are using the linux ARM binary of mkcert? Have you tried the amd64 version? |
I only just noticed that I used the
If I enter the image interactively and run the same commands (as best I know how... I imagine this is not entirely safe for complex Dockerfiles)... it fails the same way. And its very confusing because I see the file here and it's executable.
|
Why would this work with the |
OK, so it seems like I'm just in regular "Go on Alpine" territory and should probably try something like this https://stackoverflow.com/a/52057474/3619 |
If the binary was built on a glibc system, it will fail on Alpine (which is musl libc based) with a "not found" error. You can try turning cgo off. |
@FiloSottile I think @AnthonyMastrean uses a released mkcert binary... are those built with cgo on? |
@larzza yeah, I was trying to use the prebuilt binaries from the releases tab on GitHub... I'm not super interested in
🤗 |
😊 And I thought that your aproach should work , at least with amd64... have you tried with building the image with for example debian:stretch-slim instead? |
Not yet, although that's probably my next step. I'm just starting to explore self-signed certs for some of our Docker development workflows. I know... I should be generating these on the actual Docker host and using |
Yeah, the releases are linked against glibc, I believe. Dropping cgo would make os/user name detection worse, but maybe it's worth it. I'll think about it. In the meantime, what you listed are the options indeed. |
@AnthonyMastrean If you add this to your dockerfile it should work with alpine... i.e install glibc. https://gist.github.com/larzza/0f070a1b61c1d6a699653c9a792294be |
I have a simple Dockerfile that uses the binary from GitHub.
Dockerfile
When I build this locally, everything is OK.
But, when I run the same in a GitLab pipeline (uses Docker-in-Docker), it goes haywire!
.gitlab-ci.yml
Pipeline log
Does anyone have any ideas?
The text was updated successfully, but these errors were encountered: