mirror of https://github.com/mpolden/echoip
Build without cgo
This commit is contained in:
parent
99f9556173
commit
3a91baab21
|
@ -2,7 +2,8 @@
|
|||
FROM golang:1.12-stretch AS build
|
||||
WORKDIR /go/src/github.com/mpolden/echoip
|
||||
COPY . .
|
||||
ENV GO111MODULE=on
|
||||
# Must build without cgo because libc is unavailable in runtime image
|
||||
ENV GO111MODULE=on CGO_ENABLED=0
|
||||
RUN make
|
||||
|
||||
# Run
|
||||
|
|
7
Makefile
7
Makefile
|
@ -39,5 +39,10 @@ docker-build:
|
|||
docker-login:
|
||||
@echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin
|
||||
|
||||
docker-push: docker-login
|
||||
docker-test:
|
||||
$(eval CONTAINER=$(shell docker run --rm --detach --publish-all $(DOCKER_IMAGE)))
|
||||
$(eval DOCKER_PORT=$(shell docker port $(CONTAINER) | cut -d ":" -f 2))
|
||||
curl -qfsS -m 5 localhost:$(DOCKER_PORT) > /dev/null; docker stop $(CONTAINER)
|
||||
|
||||
docker-push: docker-test docker-login
|
||||
docker push $(DOCKER_IMAGE)
|
||||
|
|
Loading…
Reference in New Issue