This blog will demonstrate how to run the Linux container on Windows.
How to Run Linux Container on Windows?
Docker is developed in Linux and is effectively used in Linux distribution. Therefore, developers preferred to use Linux containers for development and deployment. To use or run the Linux container on Windows, utilize the given instructions.
Step 1: Launch Docker and Switch to Linux Containers
First, launch Docker from the Start menu. After that, click on the below highlighted drop-up menu from Taskbar. Here, you will find the Docker icon as shown below:
Right-click on the Docker icon and select the “Switch to Linux containers” option from the appeared context menu:
Hit the “Switch” button to switch to Linux containers on Windows:
Step 2: Log in to Docker Registry
Next, open up the terminal, and log in to the Docker registry using the “docker login” command. For instance, we have utilized the “PowerShell” Windows terminal:
Step 3: Pull “ubuntu” Image
Pull the “ubuntu” image from the Docker Hub registry:
Step 4: Run Linux Container
After that, run the ubuntu image to build and start the Linux container. Here “i” is used to execute the container interactively, and the “-t” option allocates the TTY-pseudo terminal to the running container:
For the verification, execute the Ubuntu Linux distribution command:
It can be observed that we have successfully executed the Linux update command.
You can also install any package inside the Linux container by utilizing the APT ubuntu repository using the “apt-get install <package>” command:
This is all about how to run a Linux container on Windows.
Conclusion
To run the Linux containers, first, enable the Linux containers in Windows. After that, pull the “ubuntu” image that is purely a part of Linux from the Docker Hub registry. Then, execute the image to build and run the Linux container using the “docker run -t ubuntu” command. This write-up has illustrated how to run a Linux container on Windows.