Skip to content

Commit

Permalink
Merge pull request #17 from ExpressenAB/feature/dockerbuild
Browse files Browse the repository at this point in the history
Feature/dockerbuild
  • Loading branch information
sfro authored Aug 21, 2020
2 parents c63b55b + 46e5901 commit 7961e53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ jobs:
asset_path: build/tgz/cloudmonitor_exporter_${{ steps.vars.outputs.tag }}_windows_amd64.tar.gz
asset_name: cloudmonitor_exporter_${{ steps.vars.outputs.tag }}_windows_amd64.tar.gz
asset_content_type: application/gzip
- name: Build Image
run: make docker
- name: Login to docker hub
run: docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push to docker hub
run: docker push bonniernews/cloudmonitor_exporter:${{ steps.vars.outputs.tag }}
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
FROM golang:onbuild
EXPOSE 9143
FROM alpine:latest

ARG version=0.0.0

COPY build/cloudmonitor_exporter_${version}_linux_amd64/cloudmonitor_exporter .

EXPOSE 9143
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ rpm: package
@mkdir -p build/rpm
docker run --rm -i -v $(shell pwd):/docker centos:7 /docker/package/rpm/build_rpm.sh ${VERSION}

docker: xbuild
docker build --build-arg version=${VERSION} . -t cloudmonitor_exporter:${VERSION}

0 comments on commit 7961e53

Please sign in to comment.