-
Notifications
You must be signed in to change notification settings - Fork 9
musl support #18
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
base: master
Are you sure you want to change the base?
musl support #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ARG GO_VERSION | ||
| FROM gotify/build:$GO_VERSION-linux-amd64 | ||
| ARG VCS_REF | ||
| RUN \ | ||
| apt-get update && \ | ||
| apt-get install -y musl-tools | ||
|
|
||
| ENV CGO_ENABLED=1 | ||
| ENV GOOS=linux | ||
| ENV GOARCH=amd64 | ||
| ENV GO_EXTRA_LDFLAGS="-linkmode external -extldflags '-static'" | ||
| ENV CC=musl-gcc | ||
|
|
||
| LABEL org.opencontainers.image.source="https://github.com/gotify/build" \ | ||
| org.opencontainers.image.revision=$VCS_REF | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| PROJECT=gotify/build | ||
| PROJECT=docker.io/gotify/build | ||
| GO_VERSION?=$(shell cat GO_VERSION) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: I'll wait on musl support for the next gotify/server release.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eternal-flame-AD FYI: I'll create a release today, as the new plugin support probably will take some time to fully work.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay! |
||
| VCS_REF=$(shell git describe --tags --always) | ||
|
|
||
|
|
@@ -20,6 +20,12 @@ build-linux-amd64: | |
| push-linux-amd64: | ||
| docker push ${PROJECT}:${GO_VERSION}-linux-amd64 | ||
|
|
||
| build-linux-amd64-musl: | ||
| docker build --build-arg VCS_REF=${VCS_REF} --build-arg GO_VERSION=${GO_VERSION} -t ${PROJECT}:${GO_VERSION}-linux-amd64-musl -f Dockerfile.linux-amd64-musl . | ||
|
|
||
| push-linux-amd64-musl: | ||
| docker push ${PROJECT}:${GO_VERSION}-linux-amd64-musl | ||
|
|
||
| build-linux-386: | ||
| docker build --build-arg VCS_REF=${VCS_REF} --build-arg GO_VERSION=${GO_VERSION} -t ${PROJECT}:${GO_VERSION}-linux-386 -f Dockerfile.linux-386 . | ||
|
|
||
|
|
@@ -44,5 +50,5 @@ build-linux-riscv64: | |
| push-linux-riscv64: | ||
| docker push ${PROJECT}:${GO_VERSION}-linux-riscv64 | ||
|
|
||
| build: build-linux-amd64 build-linux-arm-7 build-linux-arm64 build-linux-riscv64 build-linux-386 build-windows-amd64 build-windows-386 | ||
| push: push-linux-amd64 push-linux-arm-7 push-linux-arm64 push-linux-riscv64 push-linux-386 push-windows-amd64 push-windows-386 | ||
| build: build-linux-amd64 build-linux-amd64-musl build-linux-arm-7 build-linux-arm64 build-linux-riscv64 build-linux-386 build-windows-amd64 build-windows-386 | ||
| push: push-linux-amd64 push-linux-amd64-musl push-linux-arm-7 push-linux-arm64 push-linux-riscv64 push-linux-386 push-windows-amd64 push-windows-386 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a standard Go environment variable correct? I think I'll wait for the gotify/server changes required to make this work. Without the big picture this is difficult to review.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have to add this to the Makefile. My testing is simply add this to DOCKER_GO_BUILD and it builds correctly.
If you agree with the plugin transition I think let's just get the plugin issue out of the way first to fix the documentation issue, I tried finding a way to query at runtime whether the program is statically linked it isn't that simple, I don't want to add a permanent magic linker flag to solve a temporary problem.