tutorial on installing Docker on a Windows system

Source: Internet
Author: User
Tags ssh docker run

Hello, everyone, let's take a look at the Docker in the Windows operating system and the knowledge in which to install Docker Windows clients. The Docker engine uses Linux-specific kernel features and therefore cannot run through the Windows kernel, so (on Windows) The Docker engine creates a small virtual system that runs Linux and leverages its resources and kernels. This allows Windows Docker clients to build, run, and manage Docker containers with this virtual Docker engine. A team called Boot2docker developed an application with the same name that created a virtual machine to run a small Linux based on tiny Core Linux to run the Docker container on Windows. It runs completely in memory and requires approximately 27M of memory and can be started in 5 seconds (varies from person to person). Therefore, we can only run Linux containers in a Windows machine before the Docker engine for Windows is developed.

The following are simple steps for installing the Docker client and running the container on it.

1. Download Boot2docker

Before we start the installation, we need to boot2docker the executable file. You can download the latest version of Boot2docker from its Github. In this guide, we download the version v1.6.1 from the website. We downloaded the file named Docker-install.exe from the Web page using our favorite browser or download manager.

2. Install Boot2docker

Now we run the installation file, which installs the Window Docker client, Git for Windows (msys-git), VirtualBox, Boot2docker Linux ISO, and boot2docker management tools, which are Running a fully functional Docker engine is critical.

3. Run Boot2docker

After installing the necessary components, we start the boot2docker from the "Boot2docker start" shortcut on the desktop. It will require you to enter the SSH key to be validated later. It then starts a configured UNIX shell that manages the Docker that runs in the virtual machine.

To check for proper configuration, run the following Docker version command.

The code is as follows:

Docker version

4. Run Docker

Since Boot2docker start automatically starts a shell that has properly set the environment variable, we can start using Docker right away. Please note that if we are going to use Boot2docker as a remote Docker daemon, do not add sudo before the Docker command.

Now, let's try Hello-world example mirroring, which downloads hello-world mirrors, runs and outputs "Hello from Docker" information.

The code is as follows:

$ Docker Run Hello-world

5. Run docker using command prompt (CMD)

Now, if you want to start using Docker at the command prompt, you can open a command prompt (CMD.exe). Since Boot2docker requires Ssh.exe in PATH, we need to enter the following command at the command prompt to include the bin folder under the Git installation directory in the%PATH% environment variable.

The code is as follows:

Set path=%path%; " C:Program Files (x86) Gitbin "

After running the above command, we can run the Boot2docker start Boot2docker virtual machine at the command prompt.

The code is as follows:

Boot2docker start

Note: If you see an error message machine does no exist, run the Boot2docker init command.

Then copy the console Mark command in the diagram above to set the environment variable for the console window in Cmd.exe, and then we can run the Docker container as usual.

6. Use PowerShell to run Docker

In order to be able to run Docker in PowerShell, we need to start a PowerShell window and add Ssh.exe to the PATH variable.

The code is as follows:

$ENV:P ath = "${env:path};c:program Files (x86) Gitbin"

After running the above command, we also need to run

The code is as follows:

Boot2docker start

This prints the PowerShell command used to set the Docker that the environment variable connects to the inside of the virtual machine. We only need to run these commands in PowerShell to run the Docker container as usual.

7. Login with PUTTY

Boot2docker will generate and use public and private keys for logging in the%userprofile%.ssh directory, and we also need to use the private key in this folder. The private key needs to be converted to the PuTTY format. We can achieve it through puttygen.exe.

We need to open the Puttygen.exe and import the private key from the%userprofile%.sshid_boot2docker ("File"-> "Load" menu) and click "Save private Key". Then use the saved file to log in with docker@127.0.0.1:2022 through PuTTY.

8. Boot2docker option

The Boot2docker administration Tool provides commands, as shown below.

The code is as follows:

$ boot2docker

Usage:boot2docker.exe [ ] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit| Delete|download|upgrade|version} [ ]

Summarize

It is interesting to use Docker by Docker Windows clients. The Boot2docker management tool is a great application that enables any Docker container to run smoothly on a Linux host. If you are more careful, you will find that the user name of the Boot2docker default user is Docker, and the password is tcuser. The latest version of Boot2docker sets a host-only network adapter to provide access to the port of the container. Generally 192.168.59.103, but can be changed through VirtualBox DHCP implementation.

If you have any questions, suggestions, feedback, please write them down in the comments box below and we can improve or update our content. Thank you so much! Enjoy:-)

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.