A test playground for Docker practice.
- A GitHub account
- A Docker Hub account
- Ruby (version 2 and up) installed
- The Bundler gem installed
- Docker installed
Steps to create your own
- Create a new "automated build" repository in Docker Hub: This option can be found under the Create dropdown. Link it to your GitHub account when prompted.
- Enable automatic Docker image builds whenever you commit (optional): In your GitHub repo settings, add a webhook to Docker (browse the Add Service dropdown). If you don't enable this, you can still trigger Docker builds through the docker hub build settings page.
- Create and configure your Dockerfile: Add a
Dockerfileto the root directory of your app configured to your custom build settings and push this to GitHub. In Docker Hub's Build Settings, set the location of your Dockerfile. You can click
Triggeron the same screen to test your build, and see progress in the Build Details section.
Run this dockerized app locally
- Start the Docker Quickstart Terminal (install as part of Docker Toolbox)
Pull down and run the image:
docker run -p 8080:8080 krissy/dockertime
NB: the -p binds the ports from host to container, there are other ways to deal with EXPOSE and port binding - a decent article is here
Test your running app:
In a new Quickstart Terminal, find the IP of the docker host virtual machine:
Voila! Visit your app at
Some other commands:
Display running containers:
Display all running or stopped containers:
docker ps -a
docker [stop/start/restart] <container id or name>
Remove a stopped container instance:
docker rm <container id or name>
docker logs <container id or name>
View detailed info:
docker inspect <container id or name>
View locally cached images: