【Docker】在Windows操作系统上安装Docker

欢迎来到《小5讲堂》,大家好,我是全栈小5。
这是《Docker容器》序列文章,每篇文章将以博主理解的角度展开讲解,
特别是针对知识点的概念进行叙说,大部分文章将会对这些概念进行实际例子验证,以此达到加深对知识点的理解和掌握。
温馨提示:博主能力有限,理解水平有限,若有不对之处望指正!

在这里插入图片描述

前言

经过《Docker容器》序列上篇文章提到的,已经安装和配置好Docker环境,本篇文章主要讲讲Docker软件本身的安装,
每个人的安装都是大同小异,这也是积累经验和锻炼的过程,学习永不止步,技术在进步,我们作为技术开发人员也不能松懈。
【Docker】在Windows操作系统安装Docker前配置环境
【Docker】从Logo开始了解什么是docker
【Docker】可以将TA用于什么,简单了解下

Docker

下载

下载地址:https://www.docker.com/get-started/
学习文档地址:https://docs.docker.com/desktop/
选择Download for Windows,整个安装包大小大概590MB,也可以通过提供的文档资料进行学习,Learn how to install Docker。
在这里插入图片描述

安装

安装非常简单,运行点OK,然后等待安装完成,大概也就2、3分钟搞定,最后就是重启电脑。
在这里插入图片描述

  • 温馨提示
    这里刚开始遇到一个坑,就是勾选了上图中的【Use WSL 2 instead of Hyper-V(recommended)】
    对于刚接触的小伙伴建议取消勾选,否则后面会有很多东西需要设置,很麻烦

在这里插入图片描述
在这里插入图片描述

配置

在这里插入图片描述

  • 使用建议的设置

Complete the installation of Docker Desktop.
Use recommended settings (requires administrator password)
Docker Desktop automatically sets the necessary configurations that work for most developers.
完成Docker Desktop的安装。
使用建议的设置(需要管理员密码)
DockerDesktop会自动设置适用于大多数开发人员的必要配置。

  • 使用高级设置

Use advanced settings
You manually set your preferred configurations.
使用高级设置
您可以手动设置首选配置。
在这里插入图片描述

查看版本

cmd输入命令,docker version
在这里插入图片描述

界面

首次进入默认会提示需要注册账号进行登录,也可以下面的继续,无账号进入

  • 登录提示
    在这里插入图片描述
  • 您的用途
    此界面可以勾选您使用Docker的用途
    For work - 用于开发
    Local development - 本地开发
    Debugging images - 调试镜像
    Inspect images - 检查镜像
    Learning or teaching - 学习或教学
    Data science - 数据科学
    AI/ML - 机器学习和人工智能研究
    Deploying applications - 部署应用程序
    Hobby projects - 业余项目
    Testing applications - 测试应用程序
    I don’t know - 我不知道
    Other (specify) - 其他
    在这里插入图片描述
  • 首页界面
    在这里插入图片描述

总结:温故而知新,不同阶段重温知识点,会有不一样的认识和理解,博主将巩固一遍知识点,并以实践方式和大家分享,若能有所帮助和收获,这将是博主最大的创作动力和荣幸。也期待认识更多优秀新老博主。

### Docker Desktop on Linux Installation and Usage #### Prerequisites for Installing Docker Desktop on Linux To install Docker Desktop, the system must meet certain requirements. The operating system should be a recent version of one of these distributions: Ubuntu (18.04 LTS or later), Fedora (33 or later), Debian (10 or later). Additionally, ensure that virtualization is enabled in BIOS/UEFI settings because it's required by HyperKit which Docker Desktop uses to create VMs[^1]. #### Installation Steps Overview The process involves downloading Docker Desktop from the official website, installing dependencies like HyperKit, and then running an installer package specific to your distribution. For instance, on **Ubuntu**, after ensuring prerequisites are met: ```bash sudo apt-get update && sudo apt-get upgrade -y ``` Install necessary packages including `hyperkit`, `vfio-vsock` kernel module support via APT repository updates as per documentation guidelines provided at Docker’s site. Once all setup scripts complete successfully without errors, launch Docker Desktop through GUI application menus or command line using `com.docker.desktop`. #### Using Docker with Volumes and Containers After successful installation, interacting with containers becomes straightforward. For example, mounting local directories into container environments can be achieved using `-v` flag during runtime commands such as shown below where `${PWD}` represents current working directory path outside container while `/data` specifies internal mount point inside container filesystem structure[^3]: ```bash docker run -d --rm --name qtumd_node1 \ --network=qtum_network \ -v ${PWD}/node1_qtumd.conf:/home/qtum/qtum.conf:ro \ -v ${PWD}/node1_data:/data \ cryptominder/qtum:latest qtumd ``` This command starts a new detached (`-d`) session named `qtumd_node1` within network namespace `qtum_network`. It mounts two volumes read-only configuration file and writable data storage area respectively before executing entrypoint script defined under image tag `cryptominder/qtum:latest`. #### Accessing Running Containers Interacting directly with processes running inside active sessions requires attaching terminal interface linked against target environment. This action utilizes `exec` subcommand alongside specifying shell interpreter type intended for interactive use cases as demonstrated hereunder connecting bash instance attached to previously created service node[^2]: ```bash docker exec -it teamtalk /bin/bash ``` --related questions-- 1. What are common troubleshooting steps when facing issues launching Docker Desktop? 2. How does enabling virtualization improve performance for applications hosted within Docker containers? 3. Can you explain how networks function between host machines and their respective isolated guest instances managed by Docker? 4. In what scenarios would someone prefer utilizing bind mounts over anonymous volumes when configuring persistent storages across multiple services?
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

全栈小5

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值