diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..4164dd8 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,16 @@ +name: Docker Push +on: [push, create] +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docker image + uses: mr-smithers-excellent/docker-build-push@v2 + with: + image: mcuadros/ascode + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee3f7fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.14.0-alpine AS builder +WORKDIR $GOPATH/src/github.com/mcuadros/ascode +COPY . . +RUN GO111MODULE=on CGO_ENABLED=0 GOPROXY="https://proxy.golang.org" go build -o /bin/ascode . + +FROM alpine:latest +RUN apk --no-cache add ca-certificates +COPY --from=builder /bin/ascode /bin/ascode +CMD ["ascode"] \ No newline at end of file