Skip to content

Instantly share code, notes, and snippets.

@andretw
Last active August 29, 2015 14:11
Show Gist options
  • Save andretw/d29ac5c1243e3776db9d to your computer and use it in GitHub Desktop.
Save andretw/d29ac5c1243e3776db9d to your computer and use it in GitHub Desktop.
Docker

Remember to get the latest boot2docker and docker!

install

brew install boot2docker
brew install docker

create container

docker pull centos

init

boot2docker init

boot2docker

boot2docker start

boot2docker upgrade

boot2docker stop
boot2docker download
boot2docker up

run

boot2docker ssh
docker run --name shell -i -t centos:latest /bin/bash

other

show containers
docker ps -a
run by container id
docker start 1f561fff6352
docker attach 1f561fff6352
get container ip
docker ps -a
docker inspect container_name | grep IPAddress
sync from host to container

boot2docker currently mounts host's /Users to boot2docker vm's /Users hence, the only thing needs to do is

docker run -it -v /Users:/Users image_name bash
Cannot connect to the Docker daemon
$(boot2docker shellinit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment