Multistage build
This commit is contained in:
28
multistage-build/Makefile
Normal file
28
multistage-build/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
IMAGE_NAME=api-server-ms
|
||||
CONTAINER_NAME=api-server-ms
|
||||
|
||||
build: clean
|
||||
@docker build \
|
||||
--progress=plain \
|
||||
--tag $(IMAGE_NAME) \
|
||||
.
|
||||
|
||||
build-multistage: clean
|
||||
@docker build \
|
||||
--progress=plain \
|
||||
--tag $(IMAGE_NAME) \
|
||||
--file Dockerfile.multistage \
|
||||
.
|
||||
|
||||
run:
|
||||
@docker run \
|
||||
--name $(IMAGE_NAME) \
|
||||
--publish 3000:3000 \
|
||||
--env CONTAINER_NAME="Awesome API server" \
|
||||
--detach \
|
||||
$(CONTAINER_NAME)
|
||||
|
||||
clean:
|
||||
- @docker stop $(CONTAINER_NAME)
|
||||
- @docker rm $(CONTAINER_NAME)
|
||||
- @docker rmi $(IMAGE_NAME)
|
||||
Reference in New Issue
Block a user