Sie sind auf Seite 1von 2

wget -O boot2docker https://github.

com/boot2docker/osx-installer/releases/downlo
ad/v1.1.1/Boot2Docker-1.1.1.pkg
Open Package and install it
docker info
boot2docker start or boot2docker ip -- Idea is to find boot2docker IP
Install docker
status docker
$ sudo docker info - returns a list of any containers, any images (the building
blocks Docker uses to build containers),
the execution and storage drivers Docke
r is using, and its basic configuration
docker run - command to create a container
Docker makes use of the image to create a new container inside a filesystem.
The container has a network, IP address, and a bridge interface to talk to the l
ocal host
docker ps -a -> List of current containers
docker ps -> we will only see the running containers
sudo docker start bob_the_container -> To start a stopped container
$ sudo docker logs daemon_dave
$ sudo docker rm 80430f8d0921 -> Remove a container
$ sudo docker images -> Lists images
Your credentials will be stored in the $HOME/.dockercfg
docker info - to find the info about the
docker-machine start default (docker-machine env)
eval "$(docker-machine env default)" - connect your shell to the machine
docker run hello-world
docker-machine create - Creates a new Docker VM
docker version - For client and server version
docker run ubuntu:14.04 echo "Done Downlaoding"
docker run -it ubuntu:14.04 /bin/bash - to go inside this machine
ls
adduser xyz
adduser xyz sudo
sudo apt-get install vim
Now exit and run docker run -it ubuntu:14.04 /bin/bash
su xyz -> It will no be there
Now try exiting with ctrl + P + Q : This will not terminate the container
Detached Mode
docker run -d centos:7 ping 127.0.0.1 -c 100
Now you get a LONG ID
docker logs SHORTID (use docker ps for that)
docker run -P -d tomcat:7
Final Commands I used to run BDAS
cd /Users/danand/dockerTest -> Dockerfile
docker-machine start default
eval "$(docker-machine env default)"
docker
docker
docker
docker

build -t deepika087/testimage:1.1 .
run -p 8080:8080 -d deepika087/testimage:1.1 -- This will run container
ps -- This will show all runn ing docker processes with container Id
exec -it <CONTAINER ID> bash -- This will allow o interact with console o

f container
docker inspect <CONTAINER ID> -- Other fields of docker machine
docker-machine ls --Lists all the docker machines use the URL field as IP

Das könnte Ihnen auch gefallen