Docker Development Environment
- Clone the repository.
git clone https://github.com/kiltlifter/docker.git
- Build the Docker image.
sudo docker build -t centos6-devbox docker/centos/Dockerfile
- Start a Docker container
sudo docker run -d -P --name devbox centos6-devbox
- ssh into your container (password is "docker")
ssh -p $(sudo docker inspect devbox | sed -rn 's/"HostPort":\s"(.*)"/\1/p') docker@localhost
- Stopping the devbox container
- If you didn't name your container devbox or don't know the container name,
stop the first one.
sudo docker stop $(sudo docker ps | awk '{if (NR>1&&NR<3) {print $1}}')
sudo docker stop $(sudo docker ps | awk '{if (NR>1) {print $1}}')
- Destroying the devbox container
- Destroying the devbox image
sudo docker rmi centos6-devbox
sudo docker rmi $(sudo docker images | awk '{if (NR>1) {print $3}}')