Docker – 01-Basics


Note : Docker currently  support x64 cpu platforms and we will use ubuntu server 14.04 64 bit machine


sudo apt-get install

sudo docker version

and we must create docker group for security reason

sudo groupadd docker

sudo gpasswd -a $USER docker

sudo service docker restart

Run Docker Containers

docker run busybox echo Hello

its means create the busybox container with default image and run echo Hello

also we can create ubuntu image

docker run -it ubuntu bash

we can see list of packages

dpkg -l | wc -l

we can see all the containers by this command

docker ps

Container Sample

docker run jpetazzo/clock

if you add -d it will run on backround and it gives the job id

docker run -d jpetazzo/clock

docker ps -q

it will show running container process

if you want to see just container ids

docker ps -aq

And you can see the logs

docker logs <job id>

docker logs –tail 5 <job id>

You can kill or stop this task

docker kill <job id>

docker stop  <job id>

Diffrances between kill and stop?

Kill     -> very quick

Stop ->less than kill





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s