This tutorial will cover steps to create a docker image for getting-started code and run a container with it.
- Run a container and clone getting-started repo
docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
- Create the pod
docker cp repo:/git/getting-started/ .
- Build the docker101tutorial image
cd getting-started
docker build -t docker101tutorial . - Run a container using the image (also publish port 80 to 8001)
docker run -d -p 8001:80 --name docker-tutorial docker101tutorial
- Access the site http://localhost:8081/
- To get a shell to the container, run the following
docker exec -it docker-tutorial /bin/sh