Skip to content
Permalink
Browse files

Updated docker buildsteps to include multiarch

  • Loading branch information
antoniomika committed Oct 21, 2019
1 parent e6f0e32 commit dadfd4660c1d7c6c3112f54991207c9be31231b5
Showing with 39 additions and 10 deletions.
  1. +25 −0 .github/workflows/docker.yml
  2. +6 −3 .gitignore
  3. +6 −7 Dockerfile
  4. +2 −0 go.mod
  5. 0 keys/.gitkeep
  6. 0 pubkeys/.gitkeep
  7. 0 ssl/.gitkeep
@@ -0,0 +1,25 @@
name: Docker Image CI

Check failure on line 1 in .github/workflows/docker.yml

GitHub Actions / build

.github/workflows/docker.yml#L1

Process completed with exit code 1.

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Register multiarch for Docker
run: docker run --privileged linuxkit/binfmt:v0.7
- name: Install buildx
run: mkdir -p ~/.docker/cli-plugins && wget https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64 -O ~/.docker/cli-plugins/docker-buildx && chmod a+x ~/.docker/cli-plugins/docker-buildx
- name: Setup buildkit
run: docker buildx create --name builder && docker buildx use builder && docker buildx inspect --bootstrap && docker buildx ls
- name: Login to GitHub Docker Registry
env:
DOCKER_USERNAME: ${{ secrets.GITHUB_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- name: Build and push the Docker images
run: docker buildx build --push --platform linux/arm/v7,linux/arm64,linux/amd64 -t $GITHUB_REPOSITORY:$GITHUB_SHA .
- name: Build and push the latest Docker images
if: github.ref == 'refs/heads/master'
run: docker buildx build --push --platform linux/arm/v7,linux/arm64,linux/amd64 -t $GITHUB_REPOSITORY:latest .
@@ -1,6 +1,9 @@
keys/
pubkeys/
ssl/
keys/*
!keys/.gitkeep
pubkeys/*
!pubkeys/.gitkeep
ssl/*
!ssl/.gitkeep
sish
deploy/*
!deploy/docker-compose.yml
@@ -1,9 +1,10 @@
FROM golang:1.12.5-alpine as builder
FROM golang:1.13.2-alpine as builder
LABEL maintainer="Antonio Mika <me@antoniomika.me>"

RUN apk add --no-cache git gcc musl-dev

ENV GOCACHE /gocache
ENV CGO_ENABLED 0

WORKDIR /usr/local/go/src/github.com/antoniomika/sish

@@ -17,12 +18,10 @@ COPY . .
RUN go install
RUN go test -i ./...

FROM alpine
FROM scratch
LABEL maintainer="Antonio Mika <me@antoniomika.me>"

COPY --from=builder /usr/local/go/src/github.com/antoniomika/sish /sish
COPY --from=builder /go/bin/sish /sish/sish
WORKDIR /app
COPY --from=builder /go/bin/sish /app/sish

WORKDIR /sish

ENTRYPOINT ["/sish/sish"]
ENTRYPOINT ["/app/sish"]
2 go.mod
@@ -25,3 +25,5 @@ require (
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
)

go 1.13
No changes.
No changes.
No changes.

0 comments on commit dadfd46

Please sign in to comment.
You can’t perform that action at this time.