How to install docker on windows 10

How to install docker on windows 10

Install Docker on Windows 10

Have you previously installed Docker Toolbox, Docker Machine, or VirtualBox?

Docker for Windows now requires Microsoft’s Hyper-V. Once enabled, VirtualBox will no longer be able to run virtual machines (your VM images will still remain). You can still use docker-machine to manage remote hosts.

You have the option to import the default VM after installing Docker for Windows from the Settings menu in the System Tray.

Docker for Windows enables Hyper-V if necessary; this requires a reboot.

Requirements

Docker for Windows runs on 64-bit Windows 10 Pro, Enterprise, and Education; 1511 November update, Build 10586 or later. Docker plans to support more versions of Windows 10 in the future.

Installation

Verification

The whale in the status bar indicates a running (and accessible via terminal) Docker instance.

Windows prompts you for access every time Docker starts, allowing Docker to manage the Hyper-V VM’s. The first time Docker starts, you may need to provide the token from the Beta invitation email. When initialization completes, select About Docker from the notification area and verify you have the latest version.

Before you stop, let’s test a Dockerized webserver; from PowerShell or cmd.exe, run:

If your host does not already have it, Docker downloads nginx from Docker Hub and starts it. As soon as the download completes, point your web browser to http://docker to view the start page. You should see:

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.

Thank you for using nginx.

Common Pitfalls

If your CPU does not support virtualization, or if you do not have a 64-bit CPU, you cannot run Docker locally.

Operating System

If you do not run a 64-bit version of Windows Windows 10 Pro, Enterprise, or Education; 1511 November update, Build 10586 or later, you cannot run Docker for Windows.

You can install Docker Toolbox if you have a 64-bit version of Windows 7 or later. Alternately, you do have the option to upgrade.

Next: Install Docker on Linux
Requirements and things to know before installing Docker for Linux.

How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10

By Runnable: The service that speeds up development by providing full-stack environments for every code branch.

Install Docker Desktop on Windows

Estimated reading time: 10 minutes

Update to the Docker Desktop terms

Welcome to Docker Desktop for Windows. This page contains information about Docker Desktop for Windows system requirements, download URL, instructions to install and update Docker Desktop for Windows.

Download Docker Desktop for Windows

System requirements

Your Windows machine must meet the following requirements to successfully install Docker Desktop.

WSL 2 backend

The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 or Windows 11:

Hyper-V backend and Windows containers

Windows 10 64-bit: Pro 21H1 (build 19043) or higher, or Enterprise or Education 20H2 (build 19042) or higher.

For Windows 10 and Windows 11 Home, see the system requirements in the WSL 2 backend tab.

The following hardware prerequisites are required to successfully run Client Hyper-V on Windows 10:

Docker only supports Docker Desktop on Windows for those versions of Windows 10 that are still within Microsoft’s servicing timeline.

Containers and images created with Docker Desktop are shared between all user accounts on machines where it is installed. This is because all Windows accounts use the same VM to build and run containers. Note that it is not possible to share containers and images between user accounts when using the Docker Desktop WSL 2 backend.

Running Docker Desktop inside a VMware ESXi or Azure VM is supported for Docker Business customers. It requires enabling nested virtualization on the hypervisor first. For more information, see Running Docker Desktop in a VM or VDI environment.

About Windows containers

Looking for information on using Windows containers?

To run Windows containers, you need Windows 10 or Windows 11 Professional or Enterprise edition. Windows Home or Education editions will only allow you to run Linux containers.

Install Docker Desktop on Windows

Install interactively

Double-click Docker Desktop Installer.exe to run the installer.

If you haven’t already downloaded the installer ( Docker Desktop Installer.exe ), you can get it from Docker Hub. It typically downloads to your Downloads folder, or you can run it from the recent downloads bar at the bottom of your web browser.

When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend.

If your system only supports one of the two options, you will not be able to select which backend to use.

Follow the instructions on the installation wizard to authorize the installer and proceed with the install.

When the installation is successful, click Close to complete the installation process.

If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.

Install from the command line

After downloading Docker Desktop Installer.exe, run the following command in a terminal to install Docker Desktop:

If you’re using PowerShell you should run it as:

If using the Windows Command Prompt:

The install command accepts the following flags:

If your admin account is different to your user account, you must add the user to the docker-users group:

Start Docker Desktop

Docker Desktop does not start automatically after installation. To start Docker Desktop:

Search for Docker, and select Docker Desktop in the search results.

How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10

The Docker menu (How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10) displays the Docker Subscription Service Agreement window. It includes a change to the terms of use for Docker Desktop.

Here’s a summary of the key changes:

Click the checkbox to indicate that you accept the updated terms and then click Accept to continue. Docker Desktop starts after you accept the terms.

If you do not agree to the updated terms, the Docker Desktop application will close and you can no longer run Docker Desktop on your machine. You can choose to accept the terms at a later date by opening Docker Desktop.

For more information, see Docker Desktop License Agreement. We recommend that you also read the Blog and FAQs to learn how companies using Docker Desktop may be affected.

Updates

When an update is available, Docker Desktop displays an icon on the Docker menu to indicate the availability of a newer version. Additionally, the Software Updates section in Settings (Preferences on Mac) also notifies you of any updates available to Docker Desktop. You can choose to download the update right away, or click the Release Notes option to learn what’s included in the updated version.

Starting with Docker Desktop 4.2.0, the option to turn off the automatic check for updates is available for users on all Docker subscriptions, including Docker Personal and Docker Pro..

Docker Subscription Service Agreement

Beginning on August 31, 2021, you must agree to the Docker Subscription Service Agreement to continue using Docker Desktop. Read the Blog and the Docker subscription FAQs to learn more about the changes.

Click Download update When you are ready to download the update. This downloads the update in the background. After downloading the update, click Update and restart from the Docker menu. This installs the latest update and restarts Docker Desktop for the changes to take effect.

When Docker Desktop starts, it displays the Docker Subscription Service Agreement window. Read the information presented on the screen to understand how the changes impact you. Click the checkbox to indicate that you accept the updated terms and then click Accept to continue.

If you do not agree to the terms, the Docker Desktop application will close and you can no longer run Docker Desktop on your machine. You can choose to accept the terms at a later date by opening Docker Desktop.

Docker Desktop starts after you accept the terms.

Uninstall Docker Desktop

To uninstall Docker Desktop from your Windows machine:

Uninstalling Docker Desktop destroys Docker containers, images, volumes, and other Docker related data local to the machine, and removes the files generated by the application. Refer to the back up and restore data section to learn how to preserve important data before uninstalling.

Get started: Prep Windows for containers

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10 and 11

This tutorial describes how to:

Prerequisites

Windows 10 and 11

To run containers on Windows 10 or 11, you need the following:

Starting with the Windows 10 October Update 2018, Microsoft no longer disallows users from running a Windows container in process-isolation mode on Windows 10 Enterprise or Professional for development or test purposes. See the FAQ to learn more.

Windows Server Containers use Hyper-V isolation by default on Windows 10 and 11 to provide developers with the same kernel version and configuration that will be used in production. To learn more about Hyper-V isolation, see Isolation Modes.

Windows Server

For development environments, to run Windows Server Containers you will need a physical server or virtual machine running Windows Server.

Container-Ready Azure VMs

For many applications and orchestration paradigms it is necessary to build and deploy your own custom VMs. With the transition of support for the Windows Container Runtime to Mirantis, the container runtime is no longer provided with a marketplace VM offering. The remainder of this guide details how you can build a VM for Azure with the container runtime installed and ready to go.

Azure will continue to offer a complete and fully managed end-to-end experience through the Azure Kubernetes Service both in the cloud and on-premises. AKS and AKS-HCI are fully managed services with lower management overhead than what you are used to with custom deployments. Support for the container runtime is included within the AKS and AKS-HCI services under your Azure subscription.

There are three things to keep in mind when considering the following options. It is up to your organization to decide which aspect you want to optimize around:

Each of these methods are provided as an option to make the experience of constructing your container-ready Azure VMs as smooth as possible. The following subsections will detail the pros and cons of each option alongside how to get started.

Azure Image Builder

The benefit to using Image Builder is that the configuration is done during a build time and would not have any effect on your workload at runtime; when the VM scale set instantiates a new VM from your custom image, the image will have already been prepped so no time must be spent here and it will be immediately ready to run containers.

Azure image builder, however, can be more complex to implement and there are more steps involved than with script extensions. Additionally, while the Image Builder service is free, you must manage for the compute, storage, and networking usage associated with the build process (additional details here)

To get started with building your own Windows Server VM image, we have created a guide which details the process step-by step. The powershell scripts mentioned below can be utilized alongside this guide to install your container runtime of choice.

Make sure to cache the container images you plan to use locally on the VM! This will help improve the container start time after deployment. The scripts below will help you do this.

Custom Script Extensions

Custom Script Extensions are quicker to implement and the cost is only in the nominal price to store the script in Azure or GitHub. However, the script may only execute after a VM has been provisioned, so you must budget for additional time being spent to properly prep the VM at scale-out time.

Using the scripts offered below you can configure your VM scale sets to install the container runtime of your choice upon provisioning. Follow our guide learn how to set a custom script extension.

Install the Container Runtime

Windows 10 and 11

You can install Docker on Windows 10 or 11 Professional and Enterprise editions by using the following steps.

Download and install Docker Desktop and create a Docker account if you don’t already have one. You can create a free Docker account for personal or small business users, however, for larger businesses, there is a monthly fee. For more details, see the Docker documentation.

During installation, set the default container type to Windows containers. To switch after installation completes, you can use either the Docker item in the Windows system tray (as shown below), or the following command in a PowerShell prompt:

How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10

Windows Admin Center

You can use Windows Admin Center to properly set up a Windows Server machine as a container host. To get started, ensure you have the latest Containers extension installed on your Windows Admin Center instance. For more information on how to install and configure extensions, check out the Windows Admin Center documentation. With the Containers extension installed, target the Windows Server machine you want to configure and select the Containers option:

How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10

Click the Install button. Windows Admin Center will start the configuration of Windows Server and Docker in the background. After the process is complete, you can refresh the page and see the other functionalities of the Containers extension.

How to install docker on windows 10. Смотреть фото How to install docker on windows 10. Смотреть картинку How to install docker on windows 10. Картинка про How to install docker on windows 10. Фото How to install docker on windows 10

Windows Server

To run a Windows container you must have a supported container runtime available on your machine. The runtimes currently supported on Windows are containerd, Moby, and the Mirantis Container Runtime.

This section will detail the process of installing each on your specific copy of Windows, including a set of powershell scripts which make it easy to install each runtime in just a few steps.

Docker Community Edition (CE) provides a standard runtime environment for containers with a common API and command-line interface (CLI). It is managed by the open source community as part of the Moby Project.

To get started with Docker on Windows Server we have created a powershell script which configures your environment to enable container-related OS features and install the Docker runtime.

For more configuration details, see Docker Engine on Windows.

The Mirantis Container Runtime, formally known as Docker EE, provides the same functionality as Docker CE plus extra features built specifically for enterprise deployments.

Included here is a script which calls the Mirantis Container Runtime installation script and reboots the computer.

Please head over to the Mirantis site for more information.

Containerd is an industry-standard container runtime with an emphasis on simplicity, robustness and portability. It is available as a daemon for Linux and Windows, which can manage the complete container lifecycle of its host systemW: image transfer and storage, container execution and supervision, low-level storage and network attachments, etc.

nerdctl is a Docker-compatible CLI for containerd.

We have created an installation script which installs both for you at the same time alongside container related OS features.

This script does install the Windows CNI plugins as well, however, you will need to configure ctr/nerdctl to use the CNI configuration that best suits you.

Next steps

If you have read this guide and would like additional guidance from the Windows Containers product team, you can reach us at github/Windows-Containers where you will find information about getting time on the product team’s calendar to chat.

Now that your environment has been configured correctly, follow the link to learn how to run a container.

Подсистема Docker в Windows

Область применения: Windows Server 2022, Windows Server 2019, Windows Server 2016

Подсистема и клиент Docker не входят в состав Windows, потому их нужно устанавливать и настраивать отдельно. Кроме того, подсистема Docker может принимать множество пользовательских конфигураций. Например, можно настроить то, как управляющая программа принимает входящие запросы, сетевые параметры по умолчанию и параметры ведения журнала и отладки. В ОС Windows эти конфигурации можно указать в файле конфигурации или с помощью диспетчера служб Windows. В этом документе объясняется установка и настройка подсистемы Docker; также представлены примеры некоторых часто используемых конфигураций.

Установка Docker

Для работы с контейнерами Windows требуется Docker. Docker состоит из подсистемы Docker (dockerd.exe) и клиента Docker (docker.exe). Самый простой способ установить все необходимые компоненты изложен в кратком руководстве, которое поможет настроить и запустить первый контейнер.

Сведения об установке с помощью сценария см. в разделе Использование сценария для установки Docker EE.

Прежде чем использовать Docker, необходимо установить образы контейнеров. Дополнительные сведения см. в документации по образам контейнеров.

Настройка Docker с помощью файла конфигурации

Предпочтительным способом настройки подсистемы Docker в Windows является использование файла конфигурации. Путь к файлу конфигурации — C:\ProgramData\Docker\config\daemon.json. Если этот файл еще не существует, его можно создать.

Не все доступные параметры конфигурации Docker применяются к Docker в Windows. В примере ниже показаны параметры конфигурации, которые применяются. Дополнительные сведения о конфигурации подсистемы Docker см. в статье Docker daemon configuration file (Файл конфигурации управляющей программы Docker).

Достаточно только внести необходимые изменения в файл конфигурации. Например, в этом случае подсистема Docker настраивается на прием входящих подключений через порт 2375. В других параметрах конфигурации будут использоваться значения по умолчанию.

В примере ниже управляющая программа Docker настраивается на прием только защищенных подключений через порт 2376.

Настройка Docker в службе Docker

Распространенные конфигурации

В следующих примерах файла конфигурации представлены распространенные конфигурации Docker. Их можно объединить в один файл конфигурации.

Создание сети по умолчанию

Чтобы настроить подсистему Docker таким образом, чтобы не была создана сеть NAT по умолчанию, используйте следующую конфигурацию.

Дополнительные сведения см. в статье Управление сетями Docker.

Задание группы безопасности для Docker

Конфигурация прокси-сервера

После задания переменной перезапустите службу Docker.

Дополнительные сведения см. в разделе Windows Configuration File (Файл конфигурации Windows) на сайте Docker.com.

Удаление Docker

В этом разделе описывается, как удалить Docker и выполнить полную очистку компонентов системы Docker в Windows 10 или Windows Server 2016.

Все команды в этих инструкциях необходимо выполнять из сеанса PowerShell с повышенными привилегиями.

Подготовка системы к удалению Docker

Перед удалением Docker убедитесь, что в системе не запущены контейнеры.

Выполните следующие командлеты, чтобы найти работающие контейнеры:

Кроме того, перед удалением Docker рекомендуется удалить все контейнеры, образы контейнеров, сети и тома из системы. Это можно сделать, выполнив следующий командлет:

Удаление Docker

Затем необходимо начать собственно удаление Docker.

Удаление Docker в Windows 10

Удаление Docker в Windows Server 2016

В сеансе PowerShell с повышенными привилегиями используйте командлеты Uninstall-Package и Uninstall-Module, чтобы удалить модуль Docker и соответствующий ему поставщик Управление пакетами из системы, как показано в следующем примере:

Очистка данных и системных компонентов Docker

После удаления Docker необходимо удалить сети Docker по умолчанию, чтобы их конфигурация не оставалась в системе после того, как Docker будет удален. Это можно сделать, выполнив следующий командлет:

Удалите сети по умолчанию Docker в Windows Server 2016.

Выполните следующий командлет, чтобы удалить программные данные Docker из системы:

Можно также удалить необязательные компоненты Windows, связанные с Docker и контейнерами в Windows.

К ним относится компонент «Контейнеры», который автоматически включается в любом экземпляре Windows 10 или Windows Server 2016 при установке Docker. Это также может быть компонент «Hyper-V», который автоматически включается в Windows 10 при установке Docker, однако в Windows Server 2016 он включается вручную.

Компонент Hyper-V является общим компонентом виртуализации, который обеспечивает гораздо большую функциональность, чем при использовании одних только контейнеров. Прежде чем отключить Hyper-V, убедитесь, что в системе нет других виртуальных компонентов, которые зависят от Hyper-V.

Удаление компонентов Windows 10

Удаление компонентов Windows Server 2016

В сеансе PowerShell с повышенными привилегиями выполните следующие командлеты, чтобы отключить компоненты Контейнеры и (необязательно) Hyper-V.

Перезагрузка системы

Чтобы завершить удаление компонентов и очистить систему, выполните следующий командлет из сеанса PowerShell с повышенными привилегиями для перезагрузки системы:

Docker Engine on Windows

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016

The Docker Engine and client aren’t included with Windows and need to be installed and configured individually. Furthermore, the Docker Engine can accept many custom configurations. Some examples include configuring how the daemon accepts incoming requests, default networking options, and debug/log settings. On Windows, these configurations can be specified in a configuration file or by using Windows Service control manager. This document details how to install and configure the Docker Engine, and also provides some examples of commonly used configurations.

Install Docker

You need Docker in order to work with Windows Containers. Docker consists of the Docker Engine (dockerd.exe), and the Docker client (docker.exe). The easiest way to get everything installed is in the quickstart guide, which will help you get everything set up and run your first container.

Before you can use Docker, you’ll need to install the container images. For more information, see docs for our container base images.

Configure Docker with a configuration file

The preferred method for configuring the Docker Engine on Windows is using a configuration file. The configuration file can be found at ‘C:\ProgramData\Docker\config\daemon.json’. You can create this file if it doesn’t already exist.

Not every available Docker configuration option applies to Docker on Windows. The following example shows the configuration options that do apply. For more information about Docker Engine configuration, see Docker daemon configuration file.

You only need to add the desired configuration changes to the configuration file. For example, the following sample configures the Docker Engine to accept incoming connections on port 2375. All other configuration options will use default values.

The following sample configures the Docker daemon to only accept secured connections over port 2376.

Configure Docker on the Docker service

You don’t need to run this command if your daemon.json file already contains the «hosts»: [«tcp://0.0.0.0:2375»] entry.

Common configuration

The following configuration file examples show common Docker configurations. These can be combined into a single configuration file.

Default network creation

To configure the Docker Engine so that it doesn’t create a default NAT network, use the following configuration.

Set Docker security group

When you’ve signed in to the Docker host and are locally running Docker commands, these commands are run through a named pipe. By default, only members of the Administrators group can access the Docker Engine through the named pipe. To specify a security group that has this access, use the group flag.

Proxy configuration

Once the variable has been set, restart the Docker service.

How to uninstall Docker

This section will tell you how to uninstall Docker and perform a full cleanup of Docker system components from your Windows 10 or Windows Server 2016 system.

You must run all commands in these instructions from an elevated PowerShell session.

Prepare your system for Docker’s removal

Before you uninstall Docker, make sure no containers are running on your system.

Run the following cmdlets to check for running containers:

It’s also good practice to remove all containers, container images, networks, and volumes from your system before removing Docker. You can do this by running the following cmdlet:

Uninstall Docker

Next, you’ll need to actually uninstall Docker.

To uninstall Docker on Windows 10

To uninstall Docker on Windows Server 2016:

From an elevated PowerShell session, use the Uninstall-Package and Uninstall-Module cmdlets to remove the Docker module and its corresponding Package Management Provider from your system, as shown in the following example:

Clean up Docker data and system components

After you uninstall Docker, you’ll need to remove Docker’s default networks so their configuration won’t remain on your system after Docker is gone. You can do this by running the following cmdlet:

To remove Docker’s default networks on Windows Server 2016.

Run the following cmdlet to remove Docker’s program data from your system:

You may also want to remove the Windows optional features associated with Docker/containers on Windows.

This includes the «Containers» feature, which is automatically enabled on any Windows 10 or Windows Server 2016 when Docker is installed. It may also include the «Hyper-V» feature, which is automatically enabled on Windows 10 when Docker is installed, but must be explicitly enabled on Windows Server 2016.

The Hyper-V feature is a general virtualization feature that enables much more than just containers. Before disabling the Hyper-V feature, make sure there are no other virtualized components on your system that require Hyper-V.

To remove Windows features on Windows 10:

To remove Windows features on Windows Server 2016:

From an elevated PowerShell session, run the following cmdlets to disable the Containers and (optionally) Hyper-V features from your system:

Reboot your system

To finish uninstallation and cleanup, run the following cmdlet from an elevated PowerShell session to reboot your system:

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *