Add Docker workflow. Add ARM build.#745
Conversation
|
I like the idea of encouraging diversification of container registries by not including Docker Hub (even at the added end-user expense/learning curve of not being able to "find" it easily). What do you think about removing the publish step to DH? In the end I would defer to @groob for the final verdict. :) |
|
I'm all for decentralization. Heck I wish we were discussing this on Gitlab or Sourcehut. Centralizing image distribution by solely using GHCR doesn't seem like an effective measure to encourage the adoption of other image registries though. From a purely technical aspect, Docker/Kubernetes tooling already privileges Docker Hub: By leaving up the Docker Hub images, we're adding an undocumented implicit distinction, where you need to know that a hostname prefix is required in your image tag in order to avoid downloading an image from February 2017. If you're not following Docker Inc's slow decay, it's difficult to tell which is correct Are there plans to delete the micromdm Docker Hub repository? Otherwise this PR is adding a bit of automation to a footgun. I see @khawaga and @nielshojen maintain micromdm images on quay.io and Docker Hub respectively, if they'd like to chime in. |
How do you describe effective measures? At the very least omitting DH doesn't perpetuate the naive use of a de facto registry which I think is better than nothing.
This is exactly my point. By not using those default registries it's a sort of forcing function for those less familiar with other registries to at least become familiar with alternatives.
That's why we'd document it. :)
Yes. We deleted the |
Done |
|
|
||
| WORKDIR /go/src/github.com/micromdm/micromdm/ | ||
|
|
||
| ARG TARGETARCH |
There was a problem hiding this comment.
Do these have reasonable defaults or are they mandatory when doing a docker build?
There was a problem hiding this comment.
There are implicit default values for this already, which are overridden by the --platform flag in the buildx step.
Example Dockerfile:
FROM alpine
ARG TARGETPLATFORM
RUN echo "$TARGETPLATFORM"
Running this on an x86 machine running macOS:
docker build .
...
=> [2/2] RUN echo "linux/amd64"
vs
docker build --platform linux/arm .
...
=> [2/2] RUN echo "linux/arm/v7"
``
This adds a Github Actions workflow to build a multi-architecture Docker image when new release tags are added. Additionally, support for building ARM images is added.
Here's my most recent action run which generated builds for Github's container registry and Docker Hub
This assumes you have enabled Github Container Registry for the micromdm organization and added a Github Actions secret named
DOCKER_HUB_ACCESS_TOKENwith a Docker Hub token.