Re-use Dockerfile when building on Travis

This commit is contained in:
Martin Polden 2019-03-16 18:08:10 +01:00
parent fd7e13c98e
commit 99f9556173
3 changed files with 8 additions and 10 deletions

View File

@ -1,12 +1,10 @@
language: go language: minimal
go: services:
- stable - docker
# Go module behaviour is disabled by default for packages inside GOPATH. script:
# Turn module support on explicitly: - make docker-build
env:
- GO111MODULE=on
deploy: deploy:
- provider: script - provider: script

View File

@ -2,8 +2,8 @@
FROM golang:1.12-stretch AS build FROM golang:1.12-stretch AS build
WORKDIR /go/src/github.com/mpolden/echoip WORKDIR /go/src/github.com/mpolden/echoip
COPY . . COPY . .
ENV GO111MODULE=on CGO_ENABLED=0 ENV GO111MODULE=on
RUN go install ./... RUN make
# Run # Run
FROM scratch FROM scratch

View File

@ -39,5 +39,5 @@ docker-build:
docker-login: docker-login:
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin @echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
docker-push: docker-build docker-login docker-push: docker-login
docker push $(DOCKER_IMAGE) docker push $(DOCKER_IMAGE)