add restart policy to docker compose, add sample dockerfile for demoing features

This commit is contained in:
sid palas
2023-01-30 10:32:31 -05:00
parent 2d8ac25651
commit da615a3e6c
6 changed files with 79 additions and 18 deletions

View File

@ -12,4 +12,45 @@ compose-up-build:
.PHONY: compose-down
compose-down:
docker compose down
docker compose down
.PHONY: build-sample
build-sample:
docker build -t sample -f Dockerfile.sample .
define ENTRYPOINT_CMD_DESCRIPTION
##############################
See Dockerfile.sample for image definition.
This series of docker run commands is meant
to help you understand the interaction between
CMD and ENTRYPOINT.
The image has the following:
ENTRYPOINT [ "echo", "Hey Team 👋 (entrypoint)" ]
CMD [ "+ (cmd)" ]
##############################
endef
export ENTRYPOINT_CMD_DESCRIPTION
.PHONY: run-sample-entrypoint-cmd
run-sample-entrypoint-cmd: build-sample
@echo "$$ENTRYPOINT_CMD_DESCRIPTION"
@echo "Run with no arguments:"
docker run sample
@echo "##############################"
@echo "Run with argument (CMD is ignored):"
docker run sample "+ (argument)"
@echo "##############################"
@echo "Overriden entrypoint with no arguments (CMD is ignored):"
docker run --entrypoint echo sample
@echo "##############################"
@echo "Overriden entrypoint with arguments (CMD is ignored):"
docker run --entrypoint echo sample "Hey Team 👋 (Overriden entrypoint + arguments)"