mirror of
https://github.com/FiloSottile/mkcert.git
synced 2026-04-25 13:36:02 +03:00
[GH-ISSUE #169] Build release Linux binaries without cgo for Alpine compatibility? #106
Labels
No labels
TLS stack issue
Windows
bug
duplicate
duplicate
enhancement
help wanted
help wanted
pull-request
question
question
root store
waiting for info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mkcert#106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnthonyMastrean on GitHub (Jun 24, 2019).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/169
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?
@larzza commented on GitHub (Jun 24, 2019):
Could it be that you are using the linux ARM binary of mkcert? Have you tried the amd64 version?
@AnthonyMastrean commented on GitHub (Jun 24, 2019):
I only just noticed that I used the
armURL. I didn't mean to, must have mistakenly copied the wrong one. But, uh-oh, it gets worse when I try to use theamd64URL. It now fails in my local console, too!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.
@AnthonyMastrean commented on GitHub (Jun 24, 2019):
Why would this work with the
armbinary on my local machine anyway? I was running inside the same Docker base image (alpine). The only difference is the host (GitLab runners are CoreOS and I'm on Windows).@AnthonyMastrean commented on GitHub (Jun 24, 2019):
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
@FiloSottile commented on GitHub (Jun 24, 2019):
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.
@larzza commented on GitHub (Jun 24, 2019):
@FiloSottile I think @AnthonyMastrean uses a released mkcert binary... are those built with cgo on?
@AnthonyMastrean commented on GitHub (Jun 24, 2019):
@larzza yeah, I was trying to use the prebuilt binaries from the releases tab on GitHub... I'm not super interested in
go getto build from HEAD of mastergolangon my runtime image (usingapk --virtualtricks)golang:alpineimage🤗
@larzza commented on GitHub (Jun 24, 2019):
😊 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?
@AnthonyMastrean commented on GitHub (Jun 24, 2019):
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
VOLUME/-v. I'll get there next, promise!@FiloSottile commented on GitHub (Jun 24, 2019):
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.
@larzza commented on GitHub (Jun 24, 2019):
@AnthonyMastrean If you add this to your dockerfile it should work with alpine... i.e install glibc.
https://gist.github.com/larzza/0f070a1b61c1d6a699653c9a792294be
@kklepper commented on GitHub (Mar 20, 2020):
https://hub.docker.com/repository/docker/kklepper/mkcert_a
@franz-josef-kaiser commented on GitHub (Jan 11, 2021):
@kklepper 🥇