Build and start image using commands below:
export CMD=plain; docker build --file Dockerfile-shell-go --build-arg CMD -t signal-handling:shell-${CMD} .
docker run -d signal-handling:shell-${CMD}
stop image using command:
docker stop <CONTAINER_ID>
- Explain why docker stop doesn't stop process immediately and
- fix Dockerfile to receive termination signals.
Hints:
- use
docker inspect <CONTAINER_ID>
to explore container runtime settings - remember previous exercise
Verify that signals being sent to process end in successful closing of process.
export CMD=signal; docker build --file Dockerfile-shell-go --build-arg CMD -t signal-handling:shell-${CMD} .
docker run -d signal-handling:shell-${CMD}
Operations version of Ex2
Verify that signals being sent to process end in successful closing of process.
docker build --file Dockerfile-trap -t signal-handling:trap .
docker run -d signal-handling:trap