centosÔõôװÖÃdocker
ÒªÔÚ centos ÉÏ×°Öà docker£¬ÇëÖ´ÐÐÒÔÏ°취£º1. Ìí¼Ó docker ¹Ù·½¿ÍÕ»£»2. ×°Öà docker ÒýÇ棻3. ÆôÓò¢Æô¶¯ docker£»4. Ñé֤װÖã»5. Ìí¼ÓÓû§µ½ docker ×飻6. ×¢Ïú²¢ÖØеǼ£»7. ²âÊÔ·Ç root Óû§µÄ docker »á¼ûȨÏÞ¡£
ÔõÑùÔÚ CentOS ÉÏ×°Öà Docker
ÏȾöÌõ¼þ£º
CentOS 7 »ò¸ü¸ß°æ±¾
¾ßÓÐ root ȨÏÞµÄÓû§
°ì·¨£º
1. Ìí¼Ó Docker ¹Ù·½¿ÍÕ»
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
µÇ¼ºó¸´ÖÆ
2. ×°ÖÃ Docker ÒýÇæ
sudo yum install docker-ce docker-ce-cli containerd.io
µÇ¼ºó¸´ÖÆ
3. ÆôÓúÍÆô¶¯ Docker
sudo systemctl start docker sudo systemctl enable docker
µÇ¼ºó¸´ÖÆ
4. Ñé֤װÖÃ
sudo docker run hello-world
µÇ¼ºó¸´ÖÆ
ÈôÊÇÊä³öÀàËÆÓÚÒÔÏÂÄÚÈÝ£¬ÔòÌåÏÖ Docker ÒÑÀÖ³É×°Öò¢ÕýÔÚÔËÐУº
Hello from Docker! This message shows that your installation appears to be working correctly.
µÇ¼ºó¸´ÖÆ
5. Ìí¼ÓÓû§µ½ Docker ×é
ΪÁËÔÊÐí·Ç root Óû§ÔËÐÐ Docker ÏÂÁÄúÐèÒª½«ËüÃÇÌí¼Óµ½ docker ×éÖУº
sudo groupadd docker sudo usermod -aG docker $USER
µÇ¼ºó¸´ÖÆ
6. ×¢Ïú²¢ÖØеǼ
ʹ×é³ÉÔ±×ʸñ¸ü¸ÄÉúЧºó£¬ÄúÐèҪעÏú²¢ÖØеǼ²Å»ªÊ¹Óà Docker ÏÂÁî¡£
7. ²âÊÔ·Ç root Óû§µÄ Docker »á¼ûȨÏÞ
ÏÖÔÚÄú¿ÉÒÔʹÓÃ·Ç root Óû§ÔËÐÐ Docker ÏÂÁÀýÈ磺
docker run -it alpine /bin/sh
µÇ¼ºó¸´ÖÆ
ÈôÊÇÒ»ÇÐÕý³££¬ÄúÓ¦¸Ã»á¿´µ½ Alpine Linux µÄ shell ÌáÐÑ·û¡£
ÒÔÉϾÍÊÇcentosÔõôװÖÃdockerµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡