docker初次使用

一键安装

curl -sSL https://get.daocloud.io/docker | sh

安装测试

sudo docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:7f0a9f93b4aa3022c3a4c147a449bf11e0941a1fd0bf4a8e6c9408b2600777c5
Status: Downloaded newer image for hello-world:latest

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.
    (amd64)
 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://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

查看镜像

 docker images 
ros                 kinetic             b614f154f9db        13 months ago       1.19GB
autoware/autoware   latest-kinetic      de1d84c03070        13 months ago       6.38GB
hello-world         latest              fce289e99eb9        20 months ago       1.84kB





删除镜像

docker rmi de1d84c03070

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Docker Desktop 是一款用于在 Windows、macOS 和 Linux 操作系统上运行 Docker 容器的桌面应用程序。它简化了容器管理的过程,使开发者能够更方便地创建、部署和管理应用。以下是 Docker Desktop 的基本使用教程: 1. **安装 Docker Desktop**: - 访问 Docker 官网 (https://www.docker.com/products/docker-desktop) 下载适合你操作系统的版本。 - 根据安装向导进行步骤,包括权限设置和确认安装位置。 2. **启动和设置**: - 安装完成后,打开 Docker Desktop,可能会提示你登录 Docker Hub(如果你还没有账户)。 - 首次启动时,Docker Desktop 会初始化,可能需要一些时间来下载和配置镜像。 3. **创建并运行容器**: - 在 Docker Desktop 界面,你可以使用命令行工具(如 Dockerfile 或 Docker Compose)或图形界面。 - 执行 `docker run` 命令来运行预配置好的镜像,比如 `docker run hello-world` 来测试基础镜像。 4. **编写 Dockerfile**: 如果你想自定义镜像,可以在本地项目中创建一个 Dockerfile,定义构建过程、依赖等。 5. **容器网络和卷**: - Docker Desktop 提供了一个默认的桥接网络,可以让容器之间互相通信。 - 使用 `docker volume` 创建数据卷来持久化数据。 6. **安全性和认证**: - Docker Desktop 有内置的安全功能,如证书管理,确保容器之间的通信安全。 - 可以设置镜像拉取和推送的认证信息。 7. **资源限制和性能优化**: - 在“设置”中,你可以管理资源分配,如内存和CPU限制,以及共享文件系统。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值