Intermediate Practice Checklist¶
Level: Intermediate
Basic: Commands¶
- Get familiar with
top
,stats
,logs
,ps
. - Get familiar with
docker run
options, e.g.--rm
,-d
,--name
,--add-host
,--init
. - Save docker images into
tar
, andgzip
.
Reading: Docker and Zombie Process¶
Articles¶
- Docker and the PID 1 zombie reaping problem (phusion.nl)
- Run multiple services in a container | Docker Documentation
- Tini - GitHub
Practice¶
- Run a container with
--init
. - Build an image and use
tini
as the entry point.
Exercise: Run a Container to Completion¶
Instead of running a long-lasting service, a container can also be run to completion to finish a task.
Job
In Kubernetes
, a job is usually a pod expected to run to completion with an exit code of 0
.
- Use a python image to run a container to completion with exit code
0
.- It can be as simple as
echo hello
- You can try to run complicated commands.
- It can be as simple as
- Build an image to run a container to completion by default.
- Use the Jupyter image built in the previous checklist.
- Mount a script into the container and start the container to run the script to completion.
- Commands:
run
,-v/--volume
.
- Commands:
- Build an image with the script shipped, and run the container to completion.