Skip to main content

Posts

Showing posts from December, 2015

How to use Docker

Docker Docker offical webiste: https://www.docker.com/ Setup Docker Prepare fresh version of CentOS, I am using CentOS 6.7. Update the yum rep. > rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm > yum update -y   Install Docker > yum -y install docker-io Pull some image of container, I am going to use CentOS container. To pull the latest (CentOs 7) >  docker pull centos Or > docker pull centos:centos6 Check which container images are installed: > docker images REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE centos              centos6             3bbbf0aca359        2 weeks ago         190.6 MB centos              latest              ce20c473cd8a        2 weeks ago Run docker from image: > docker run -i -t centos:centos6 /bin/bash Note: this creates a container from image (you can see the ContainerID as hostname) List containers: >docker ps >docker