Docker container commands

check docker version
------------------------
docker version    

Search for image


docker search urgensherpa/lamp6
redhat@test:~/ssh_image$ docker search urgensherpa
NAME                        DESCRIPTION   STARS     OFFICIAL   TRUSTED
urgensherpa/lamp6                                        0                   

Pulling image
you@tutorial:~$ docker pull learn/tutorial
Pulling repository learn/tutorial from https://index.docker.io/v1
Pulling image 8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c (precise) from ubuntu
Pulling image b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc (12.10) from ubuntu
Pulling image 27cf784147099545 () from tutorial
you@tutorial:~$

Run commands in container   
docker run learn/tutorial echo "hello world"

installing things in the container

docker run learn/tutorial apt-get install -y ping  

docker ps -l
docker ps
=== ========== ========= =        ====================
docker commit 698989sdafd learn/ping  
====meaning==
698989sd...= container id
learn/ping = learn -username and ping - image
-----------------------------------------------------------
docker run learn/ping ping google.com      
Find info about docker container
--------------------------------
docker inspect efesdlfk     

docker images   = This will show you which images are currently on your host

docker push learn/ping   

No comments:

Post a Comment