Docker installation application (CentOS 6.5_x64)

Source: Internet
Author: User

Docker installation application (CentOS 6.5_x64)

Docker installation application (CentOS 6.5_x64)

Authoer: jom_ch @ 2014/7/23

Docker official http://www.docker.com/

1. Install EPEL
 
EPEL: https://Fedoraproject.org/wiki/EPEL/zh-cn
 
> Rpm-ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
> Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
> Yum-y install yum-priorities
 

2. Install Docker
 
> Yum-y install docker-io
> Service docker start
> Chkconfig docker on
 

3. Apply Docker
 
1. Obtain the Centos Image
> Docker pull centos: latest
 
2. view the image running status
> Docker images centos
 
3. Run shell bash in the container.
> Docker run-I-t centos/bin/bash
 
4. Stop the container.
> Docker stop <container id>
 
5. View container logs
> Docker logs-f <container id>
 
6. Delete all containers
> Docker rm $ (docker ps-a-q)
 
7. delete an image
> Docker rmi <image id/name>
 
8. Submit the changes to the image repository.
> Docker run-I-t centos/bin/bash
> Useradd myuser
> Exit
> Docker ps-a | more
> Docker commit <container id> myuser/centos
 
9. Create and run hello. sh in the container
> Docker run-I-t myuser/centos/bin/bash
> Touch/home/myuser/hello. sh
> Echo "echo \" Hello, World! \ "">/Home/myuser/hello. sh
> Chmod + x/home/myuser/hello. sh
> Exit
> Docker commit <container id> myuser/centos
> Docker run-I-t myuser/centos/bin/sh/home/myuser/hello. sh
 
10. Run Nginx in the container
 
Install Nginx in the container and submit it to the image
> Docker run-t-I-p 80: 80 nginx/centos/bin/bash
Start Nginx
>/Data/apps/nginx/sbin/nginx
(It is not clear how to run in the background !!!)
 
Access the host machine port 80 in the browser.
 
11. Map container ports
> Docker run-d-p 192.168.9.11: 2201: 22 nginx/centos/usr/sbin/sshd-D
 
Connect the container with ssh root@192.168.9.11-p 2201 with the prompt:
 
Connection to 192.168.1.205 closed. (This problem has not been solved !!!)
 

Possible problems:
# An error is reported when the user password is changed in the container:
/Usr/share/cracklib/pw_dict.pwd: No such file or directory
PWOpen: No such file or directory
 
Solution:
Yum-y reinstall cracklib-dicts

New virtualization options for the open-source project Docker and Red Hat

Dockerlite: lightweight Linux Virtualization

Detailed explanation of the entire process of building Gitlab CI for Docker

What is the difference between Docker and a normal Virtual Machine?

Use MySQL in Docker

Docker will change everything

Official version of Docker 1.0 is released and downloaded

Docker details: click here
Docker: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.