美文网首页
docker笔记

docker笔记

作者: 编程放大镜 | 来源:发表于2022-05-17 14:52 被阅读0次

通过 docker inspect 命令,我们可以获取镜像的详细信息,其中,包括创建者,各层的数字摘要等。

https://developpaper.com/the-method-of-using-nginx-to-proxy-multiple-application-sites-in-docker/

连接问题

容器之间可以通过容器名称来连接,如nginx配置文件中连接php的代码fastcgi_pass php_container_name:9000,网站数据库配置文件使用mysql_container_name:3306。

docker exec

在已运行容器中执行命令

docker exec -w /user/work/ container_name pwd

参数解释
-w 在容器中的工作路径

docker exec -ti container_name bash

参数解释
-i 进入交互模式
-t 分配伪tty

参考资料

https://docs.docker.com/engine/reference/commandline/exec/

相关文章

网友评论

      本文标题:docker笔记

      本文链接:https://www.haomeiwen.com/subject/swhrlctx.html