Docker在Windows下的安装使用与常见问题

来源:互联网 发布:jsp引入java 编辑:程序博客网 时间:2024/06/01 09:09

1. Docker for Windows安装

  • 官方文档及下载
    • 建议下载稳定版Stable channel
    • 2017-7-19 官网 InstallDocker.msi下载
  • 安装条件
    • Docker for Windows 需要安装系统版本 Windows 10 64位 专业版 和 Microsoft Hyper-V(Docker安装包自带,不需额外下载).
    • 如果你的系统不满足以上条件请安装 2017-7-19 官网 Docker Toolbox下载, 使用了 Oracle Virtual Box 替代 Hyper-V
    • 模拟开发环境不建议安装使用DockerToolbox ->Win10家庭版升级至Win10专业版,控制面板-系统和安全-系统-更换产品密钥 “VK7JG-NPHTM-C97JM-9MPGT-3V66T”
    • Hyper-V需开启硬件虚拟化 教程

2. 常见安装及运行问题

  • 安装Docker for Windows后会提示安装Hyper-V虚拟机,安装完成后需重启电脑才可使用
  • 安装完成重启后自动启动docker成功后,右键右下角docker图标-settings进入设置如图

这里写图片描述

  • 选择共享盘符,勾选后需输入你电脑PC用户开机登录密码

这里写图片描述

  • 若偶尔docker for windows启动失败,属抽风正常现象,请重新启动docker或重启电脑,仍无法启动请考虑尝试恢复默认设置(谨慎!将清空已安装好的所有镜像)

这里写图片描述

  • Toolbox版本安装后启动需下载镜像,请保持网络通畅,等待下载完毕后将启动成功

3. Docker的使用

  • 常用命令
    docker ps -a 查看所有运行镜像
    docker images 查看已安装镜像
    docker start/stop CONTAINER_ID 启动或关闭相应镜像

4. What is docker 什么是docker

Overview

Docker is the world’s leading software container platform. Developers
use Docker to eliminate “works on my machine” problems when
collaborating on code with co-workers. Operators use Docker to run and
manage apps side-by-side in isolated containers to get better compute
density. Enterprises use Docker to build agile software delivery
pipelines to ship new features faster, more securely and with
confidence for both Linux and Windows Server apps.

What is a Container?

Using containers, everything required to make a piece of software run
is packaged into isolated containers. Unlike VMs, containers do not
bundle a full operating system - only libraries and settings required
to make the software work are needed. This makes for efficient,
lightweight, self-contained systems and guarantees that software will
always run the same, regardless of where it’s deployed.
Docker For Developers

Docker automates the repetitive tasks of setting up and configuring
development environments so that developers can focus on what matters:
building great software.

docker for developers Developers using Docker don’t have to install
and configure complex databases nor worry about switching between
incompatible language toolchain versions. When an app is dockerized,
that complexity is pushed into containers that are easily built,
shared and run. Onboarding a co-worker to a new codebase no longer
means hours spent installing software and explaining setup procedures.
Code that ships with Dockerfiles is simpler to work on: Dependencies
are pulled as neatly packaged Docker images and anyone with Docker and
an editor installed can build and debug the app in minutes.

待编辑…

原创粉丝点击