docker的学习

目前,CentOS 仅发行版本中的内核支持 Docker。

Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。

Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。

通过 uname -r 命令查看你当前的内核版本

用docker version命令查看docker版本

docker info查看docker存储位置

用service docker start命令启动docker服务,最好用最好使用systemctl start docker替代service docker start,原因见另一篇博客:https://blog.csdn.net/yzh_1346983557/article/details/84943287

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

服务命令只支持基本的LSB操作(启动、停止、重启、尝试重启、重载、强制重载、状态)。对于其他操作,请尝试使用systemctl。

原因:CentOS 7.x开始,CentOS开始使用systemd服务来代替daemon,原来管理系统启动和管理系统服务的相关命令全部由systemctl命令来代替。service命令只保留下了极少部分使用,大部分命令都要改用systemctl使用。

解决:使用systemctl命令替代service命令就可:systemctl start docker

启动        systemctl start docker
守护进程重启   sudo systemctl daemon-reload
重启docker服务   systemctl restart  docker
重启docker服务  sudo service docker restart
关闭docker service docker stop
关闭docker systemctl stop docker

 如何将代码推送到docker上:

查阅了很多,基本都是如下,docker上开通远程服务,然后ideal配置docker regeister,配置dockerFile,然后推送

https://www.cnblogs.com/changlai/p/10748631.html

https://blog.csdn.net/sealir/article/details/81200662#commentBox

https://blog.csdn.net/bobozai86/article/details/88875784#commentBox

原文地址:https://www.cnblogs.com/cherishforchen/p/11727671.html