This repository was archived by the owner on Jun 14, 2023. It is now read-only.
Add official Dockerfile, build official images to GitHub Packages#47
Open
jinnatar wants to merge 3 commits intoimgix:masterfrom
Open
Add official Dockerfile, build official images to GitHub Packages#47jinnatar wants to merge 3 commits intoimgix:masterfrom
jinnatar wants to merge 3 commits intoimgix:masterfrom
Conversation
- Bunary is built against go1.17.x - But served with just a plan alpine:latest image - As a result the final image size is < 19 MiB
Images are pushed into the free GitHub registry and become evailable as "packages" for the repository.
colakong
suggested changes
Feb 4, 2022
Collaborator
colakong
left a comment
There was a problem hiding this comment.
- ✅ Workflow looks to be almost verbatim the github actions container deploy example
- ✅ Dockerfile looks correct
- ❌ Built container works
The base image is alpine, and the go build steps produce a dynamically-linked library. In this scenario, if libc6-compat is not installed, the container image will produce a "No such file or directory" error when run.
An alternative to this would be to build a static binary by setting CGO_ENABLED=0 when building the binary ^^
| COPY countermap ./countermap | ||
| RUN go build | ||
|
|
||
| FROM alpine:latest |
Collaborator
There was a problem hiding this comment.
Suggested change
| FROM alpine:latest | |
| FROM alpine:latest | |
| # This is needed, for a dynamically-linked go binary when using alpine as a base image. | |
| # If you don't want to install this, then set CGO_ENABLED=0 environment variable when issuing 'go build' | |
| RUN apk add --no-cache libc6-compat |
Collaborator
|
Also, thankyou for putting this together @Artanicus 😸 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are 15 unofficial Docker images on DockerHub, so clearly there's demand for an image. All of them are either wildly out of date or do not publish their Dockerfile though, which is sub-optimal.
This PR adds a simple official Dockerfile and automated build action. An example of the automated build and an image it procudes can be seen in the fork where I'm proposing the merge from: https://ghcr.io/artanicus/prometheus-am-executor
Pushes to the
masterbranch will tag the images withlatest, all pushes to all branches are tagged withbranch_name-6-digit-hash-from-commitand any git tags are tagged as-is. So for example a release tagged as1.0would result in an image:ghcr.io/imgix/prometheus-am-executor:1.0