Docker安装和简单使用入门教程
安装
由于我本人使用的linux系统,原生支持docker,相对安装还是比较简单的
1:使用下面的官方脚本安装:
wget -qO- https://get.docker.com/ | sh
2:输入下面的命令验证是否可以查看版本号,可以就是安装成功
sudo docker version
3:建议把当前使用的用户加到Docker用户组,就可以不用很次都sudo了
sudo usermod -aG docker your_username
4:重新登录,sudo权限才会成效
logout
至此,你的docker环境就已经很快的安装完了
简单使用
一切从hello world开始,如下命令
docker run hello-world
你大致会看到如下内容
Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
现在就开始开始自己的docker学习之旅吧!
以上所述是小编给大家介绍的Docker安装和简单使用入门教程,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
相关文章
docker安装elasticsearch和kibana的方法步骤
这篇文章主要介绍了docker安装elasticsearch和kibana的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-06-06
docker在已有的tomcat镜像上打新的镜像的Dockerfile编写说明介绍
这篇文章主要介绍了docker在已有的tomcat镜像上打新的镜像的Dockerfile编写说明介绍,需要的朋友可以参考下2016-10-10
Docker给容器添加新端口映射的两种方法及常用命令举例详解
Docker是一个开源的应用容器引擎,允许开发者打包和发布应用到任何流行的Linux机器上,并实现虚拟化,这篇文章主要介绍了Docker给容器添加新端口映射的两种方法及常用命令的相关资料,需要的朋友可以参考下2025-03-03
docker通过Dockerfile修改镜像中tomcat的端口
8080端口会经常出现被占用的情况,本文主要介绍了docker通过Dockerfile修改镜像中tomcat的端口,具有一定的参考价值,感兴趣的可以了解一下2023-10-10


最新评论