尊龙凯时人生就是搏

docker´ò²»¿ªÍøÒ³

µ±Ê¹Óà docker ÎÞ·¨·­¿ªÍøҳʱ  £¬Ôµ¹ÊÔ­ÓÉ¿ÉÄÜÊÇ£ºÈÝÆ÷¶Ë¿ÚÓ³ÉäÉèÖò»×¼È·¡£ÈÝÆ÷Æô¶¯¾ç±¾ÖÐδÆôÓà web ЧÀÍÆ÷¡£Ö÷»ú·À»ðǽ×èÖ¹¶Ë¿Ú»á¼û¡£ÈÝÆ÷ web ЧÀÍÆ÷ÕìÌý¹ýʧµÄ ip¡£Ö÷»úºÍÈÝÆ÷Ö®¼ä±£´æÍøÂçÎÊÌâ¡£ÈÝÆ÷ÖÐδװÖà web ЧÀÍÆ÷¡£

Docker ´ò²»¿ªÍøÒ³£ºÔµ¹ÊÔ­ÓÉÏ¢Õù¾ö¼Æ»®

µ±Ê¹Óà Docker ʱ  £¬ÎÞ·¨·­¿ªÍøÒ³¿ÉÄÜÊÇÓÉÓÚÒÔÏÂÔµ¹ÊÔ­ÓÉ£º

1. ÈÝÆ÷µÄ¶Ë¿ÚÓ³ÉäÉèÖùýʧ

È·±£ÈÝÆ÷µÄ¶Ë¿ÚÓ³ÉäÉèÖÃ׼ȷ¡£ÀýÈç  £¬ÈôÊÇÄúÏ£ÍûÈÝÆ÷ÔÚ¶Ë¿Ú 80 ÉÏÌṩ Web ЧÀÍ  £¬ÔòÈÝÆ÷±ØÐèÓ³Éäµ½Ö÷»úµÄ¶Ë¿Ú 80£º

docker run -p 80:80 

µÇ¼ºó¸´ÖÆ

2. ÈÝÆ÷µÄÆô¶¯¾ç±¾ÖÐûÓÐÆô¶¯ Web ЧÀÍÆ÷

¼ì²éÈÝÆ÷µÄÆô¶¯¾ç±¾ÒÔÈ·±£ËüÆô¶¯ÁË Web ЧÀÍÆ÷¡£ÀýÈç  £¬¹ØÓÚ Apache Web ЧÀÍÆ÷£º

/usr/sbin/apache2ctl start

µÇ¼ºó¸´ÖÆ

3. Ö÷»ú·À»ðǽ×èÖ¹»á¼û¶Ë¿Ú

¼ì²éÖ÷»ú·À»ðǽÊÇ·ñ×èÖ¹¶ÔÈÝÆ÷¶Ë¿ÚµÄ»á¼û¡£ÔÚ Linux ϵͳÉÏ  £¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî½ûÓ÷À»ðǽ£º

sudo ufw disable

µÇ¼ºó¸´ÖÆ

4. ÈÝÆ÷ÄÚµÄ Web ЧÀÍÆ÷ÕìÌý¹ýʧµÄ IP µØµã

ĬÈÏÇéÐÎÏ  £¬ÈÝÆ÷ÄÚµÄ Web ЧÀÍÆ÷ÕìÌý 127.0.0.1£¨µ±ÌïÖ÷»ú£©¡£ÈôÊÇÄúÏ£ÍûËüÔÚËùÓÐÖ÷»ú IP µØµãÉÏÕìÌý  £¬Çë±à¼­ÉèÖÃÒÔ¸ü¸Ä°ó¶¨µÄ IP¡£ÀýÈç  £¬¹ØÓÚ Apache£º

sudo nano /etc/apache2/ports.conf

µÇ¼ºó¸´ÖÆ

½« Listen 127.0.0.1 ¸ü¸ÄΪ Listen 0.0.0.0¡£

5. Ö÷»úºÍÈÝÆ÷Ö®¼äµÄÍøÂçÎÊÌâ

¼ì²é Docker ÍøÂçÉèÖÃÒÔÈ·±£Ö÷»úºÍÈÝÆ÷Ö®¼ä±£´æÊʵ±µÄÅþÁ¬¡ £¿ÉÒÔʹÓà docker network ls ÏÂÁîÉó²éÍøÂçÃû³Æ¡£ÈôÊÇÖ÷»úºÍÈÝÆ÷²»ÔÚͳһÍøÂçÖÐ  £¬ÇëʹÓà docker network connect ÏÂÁÈÝÆ÷ÅþÁ¬µ½Ö÷»úÍøÂç¡£

6. ÈÝÆ÷ÖÐûÓÐ×°Öà Web ЧÀÍÆ÷

È·±£ÄúÒÑÔÚÈÝÆ÷ÖÐ×°ÖÃÁË Web ЧÀÍÆ÷  £¬ÀýÈç Apache »ò Nginx¡ £¿ÉÒÔʹÓà docker exec ÏÂÁîÅþÁ¬µ½ÈÝÆ÷²¢¼ì²éÒÑ×°ÖõÄÈí¼þ°ü£º

docker exec -it  sh
dpkg -l | grep apache

µÇ¼ºó¸´ÖÆ

ÒÔÉϾÍÊÇdocker´ò²»¿ªÍøÒ³µÄÏêϸÄÚÈÝ  £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí  £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø  £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È  £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ  £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢  £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢  £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå  £¬9:30-18:30  £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ