Learning bits and pieces of container (c)

First, the vessel is able to use mysql?

The answer is yes. MySQL, the docker run Apache, just to exert its elastic characteristics of the container, the number of starts of the container depending on the respective capabilities traffic.

docker pull mysql mysql container is removed from the public repository dockerhub

docker run --name=some-mysql -d -P -e MYSQL_ROOT_PASSWORD=mypassword mysql

--name name parameter is specified docker

-d representatives running in the background

-P capital on behalf of the 3306 internal port Dockfile exposed in randomly assigned to an external port

-e parameter is passed in an environment variable, the variable here is the password

 

By running this command, we docker ps -a found associated with external random port 32771 to 3306 mysql exposed ports.

0.0.0.0:32771->3306/tcp

 

Second, whether the container can use any host in the directory or file?

The answer is yes. Advantages of the container is also here, as there is no virtual machine operating system as complex intermediate layer, the container can be any directory on the host to mount.

Type the following command, we will host the / my / custom covers docker in /etc/mysq/conf.d directory

docker run --name some-mysql -v /my/custom:/etc/mysql/conf.d -d mysql

 

Moreover, the government has also recommended that hang way to achieve data volumes when docker persistent data files, avoid docker is deleted, all data can also be deleted as a docker.

 

Third, the container downloads start so complicated, there is no unified management tool?

OpenStack is like a virtual machine management, and Kubernates open source tool is the management of the container. Currently K8s basically become a standard component container management in some public cloud using K8s itself is free of charge, just occupied by the virtual machine charges.

K8s composition of Master, Node node, Master, while the nodes are generally included in the Node public cloud as a virtual machine in a node Node node Pod, Pod node is the general end-use containers.

By K8s configuration, it is possible to create Pod nodes, launch, configuration, and automatically elastically stretchable Pod nodes according to traffic without traffic.

I hope this article can help you.

More real-time updates, visit public number.    

 

Click here to get the highest ¥ 1888 Ali cloud offering universal vouchers

Guess you like

Origin blog.csdn.net/qq_29718979/article/details/92134964