Changes

From SME Server
Jump to navigationJump to search
957 bytes added ,  12:45, 9 September 2014
m
no edit summary
Line 75: Line 75:  
* Note: See if we can change this default location in another way, config file?
 
* Note: See if we can change this default location in another way, config file?
   −
 
+
===Downloading a docker image===
 
To download the centos6 image to your local server, issue the following command as root:
 
To download the centos6 image to your local server, issue the following command as root:
 
  docker pull centos:centos6
 
  docker pull centos:centos6
Line 82: Line 82:  
Once the image has been downloaded, you can check your local images by issuing:
 
Once the image has been downloaded, you can check your local images by issuing:
 
  docker images
 
  docker images
 +
 +
 +
===Running a docker container===
 +
Now that we have downloaded the centos6 image it's time to give it a spin. To start the cento6 container we can issue the follwoing command:
 +
docker run -t -i centos:centos6 bash
 +
This will tell docker to run the centos6 container interactiveley from the local centos repo and start bash. After a few seconds you will be presented with the bash prompt inside the centos6 container:
 +
bash-4.1#
 +
and to check if we are really inside the centos6 container we can display the release version:
 +
cat /etc/redhat-release
 +
which will result in:
 +
CentOS release 6.5 (Final)
 +
From here you can use the normal commands like yum etc.
 +
 +
To exit the container you give the normal 'exit' command, which will stop the centos6 container and bring you back to the prompt of your local server.
 +
 +
To run a container in the background, you need to issue to docker run command with the -d flag instead of the -i flag
 +
     

Navigation menu