The first step to creating an image is to create a container and fill it with some data.
First we'll create a container with a single new file based off of the ubuntu
base image:
docker run ubuntu echo "fun" > newfile
The container will immediately terminate (because its one command is echo
), so we'll use docker ps -l
to list it:
docker ps -l CONTAINER ID IMAGE COMMAND CREATED 07f2065197ef ubuntu:12.04 echo fun 31 seconds ago