Stephen McQuay (smcquay)
04e200eb54
follows along here loosely: https://docs.docker.com/develop/develop-images/multistage-build/ https://blog.alexellis.io/mutli-stage-docker-builds/
21 lines
497 B
Makefile
21 lines
497 B
Makefile
GOFILES := $(shell find . -type f | grep go$$ )
|
|
|
|
build/lim: build build/.docker-image ${GOFILES}
|
|
@echo "fetching binary from image"
|
|
@docker create --name ext smcquay/lim:latest > /dev/null
|
|
@docker cp ext:/bin/lim build/ > /dev/null
|
|
@docker rm -f ext > /dev/null
|
|
@touch build/lim
|
|
|
|
build/.docker-image: ${GOFILES}
|
|
@echo "building docker image"
|
|
@docker build --no-cache -t smcquay/lim:latest . > /dev/null
|
|
@touch build/.docker-image
|
|
|
|
build:
|
|
@mkdir build
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
@rm -rf build
|