Docker commit example

Run Alpine container in interactive mode with shell:

docker run -it alpine sh
In the container to install Redis, issue:
apk add --update redis
In another terminal, get the ID of this running container and commit the changes with startup command:
docker ps
docker commit -c 'CMD ["redis-server"]' {{ container_id }}
You'll get the new container ID with the Redis installed.