Skip to content

Commit

Permalink
Add Docker workflow. Add ARM build. (micromdm#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamtheaker authored Oct 11, 2021
1 parent f681a2b commit 6e51f09
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Build and push Docker image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Set up QEMU for multi-architecture builds
uses: docker/setup-qemu-action@c308fdd69d26ed66f4506ebd74b180abe5362145 #v1.1.0
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: Check out this repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
fetch-depth: 1 # Checkout only latest commit

- name: Login to Github Packages Container registry with ephemeral token
run: docker login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}

- name: Create builder instance
run: docker buildx create --use

- name: Build and push image
run: |
docker buildx build \
--platform linux/amd64,linux/arm,linux/arm64 \
--tag ghcr.io/micromdm/micromdm:latest \
--tag ghcr.io/micromdm/micromdm:${{ github.event.release.tag_name }} \
--push \
.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased](https://github.com/micromdm/micromdm/compare/v1.8.0...main) TBD

- Add GHCR container workflow. Add ARM build. (#745)
- New in-memory-only command queue (#736)
- Bootstrap token support (#781, #782)
- Fix potential DEP sync data loss (#779)
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ FROM golang:latest as builder

WORKDIR /go/src/github.com/micromdm/micromdm/

ARG TARGETARCH
ARG TARGETOS

ENV CGO_ENABLED=0 \
GOARCH=amd64 \
GOOS=linux
GOARCH=$TARGETARCH \
GOOS=$TARGETOS

COPY . .

Expand Down

0 comments on commit 6e51f09

Please sign in to comment.