dockerÈÝÆ÷commandÔõô¸Ä
¸ü¸Ä docker ÈÝÆ÷ÖеÄÏÂÁîÓÐÁ½ÖÖÒªÁ죺ʹÓà dockerfile£¬ÔÚ½¨ÉèÈÝÆ÷ʱָ¶¨ÃüÁʹÓà docker update ÏÂÁÔÚÈÝÆ÷½¨Éèºó¸ü¸ÄÏÂÁî¡£¸ü¸ÄÏÂÁîºó£¬ÐèÒªÖØÐÂÆô¶¯ÈÝÆ÷²Å»ªÊ¹ÐÂÏÂÁîÉúЧ¡£
ÔõÑù¸ü¸Ä Docker ÈÝÆ÷ÖеÄÏÂÁî
¸ü¸Ä Docker ÈÝÆ÷ÖеÄÏÂÁîºÜÊǼòÆÓ£¬Ö÷ÒªÓÐÁ½ÖÖÒªÁ죺
1. ʹÓà Dockerfile
ÔÚ½¨ÉèÈÝÆ÷ʱ£¬¿ÉÒÔʹÓà Dockerfile Ö¸¶¨ÒªÔËÐеÄÏÂÁî¡£Dockerfile ÊÇÒ»·ÝÎı¾Îļþ£¬ÆäÖаüÀ¨ÓÃÓÚ¹¹½¨¾µÏñµÄÖ¸Áî¡£Òª¸ü¸ÄÏÂÁÇëÔÚ Dockerfile ÖÐÓà CMD Ö¸ÁîÖ¸¶¨ÐµÄÏÂÁî¡£ÀýÈ磺
FROM ubuntu:latest CMD ["/bin/bash"]
µÇ¼ºó¸´ÖÆ
2. ʹÓà docker update ÏÂÁî
ÈôÊÇÈÝÆ÷ÒѾ½¨É裬¿ÉÒÔʹÓà docker update ÏÂÁîÀ´¸ü¸ÄÏÂÁî¡£¸ÃÏÂÁî½ÓÊÜÒ»¸öÈÝÆ÷ ID »òÃû³Æ£¬ÒÔ¼°Ò»¸öеÄÏÂÁî×÷Ϊ²ÎÊý¡£ÀýÈ磺
docker update --name my-container --cmd "/bin/bash"
µÇ¼ºó¸´ÖÆ
¸ü¸ÄÏÂÁîºó×öʲô£¿
¸ü¸ÄÏÂÁîºó£¬ÐèҪעÖØÒÔÏÂÊÂÏ
ÈÝÆ÷±ØÐèÖØÐÂÆô¶¯£ºÎªÁËʹеÄÏÂÁîÉúЧ£¬±ØÐèÖØÐÂÆô¶¯ÈÝÆ÷¡£¿ÉÒÔʹÓà docker restart ÏÂÁî¾ÙÐÐÖØÆô¡£
¸ü¸ÄºóµÄÏÂÁÁýÕÖ֮ǰµÄÏÂÁCMD Ö¸ÁÁýÕÖÏÈÇ°Ö¸¶¨µÄÈκÎÏÂÁî¡£
Docker Compose£ºÈôÊÇÄúʹÓà Docker Compose ÖÎÀíÄúµÄÈÝÆ÷£¬ÔòÐèÒª¸üРdocker-compose.yml ÎļþÒÔÖ¸¶¨ÐµÄÏÂÁî¡£
ÒÔÉϾÍÊÇdockerÈÝÆ÷commandÔõô¸ÄµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡