[一日30分 인생승리의 학습법] How to Run :  Linux Containers on Windows Server 2019

How to Run ???? Linux Containers on Windows Server 2019

Save to My DOJO

How to Run ???? Linux Containers on Windows Server 2019

Hello again everyone! This article will serve as part 5 of our “Definitive Guide to Containers for MSPs” series. Once again, this series is focusing on the new containerization technologies entering the industry today and looking at them through the lens of an MSP.

Thus far we’ve done quite a bit of how-to, and we’re going to continue to work on the how-to question for the next few segments. The reason being, when we start talking about things like pricing, service delivery, and on-going support, you need to have a strong grasp of what’s involved in the platform, so you can make informed decisions at that point. With that in mind we’re going to look at docker itself for another segment or two, and then we’ll start getting into container orchestrators like Kubernetes.

Let’s see what we’ve talked about thus far.

The Definitive Guide to Containers for MSPs

Part 1 – What are Containers?

Part 2 – Platforms for Running Containerized Workloads

Part 3 – Introduction to Docker

Part 4 – 4 Pro Tips when Working with Docker

For this segment specifically, I wanted to cover how to run Linux containers on Windows Server 2019. I came up with this idea as I was prepping for our latest webinar that centered around demos with Windows Server 2019. While it’s easy enough to run containers on Windows 10 as we did in Part 3, it’s more difficult to do it on a VM where there is no GUI, and you can’t simply install docker for Windows.

So, let’s take a look at how the installation process works, and then we’ll proceed with running a container on top of it. Once this is complete, you’ll have everything you need to run Linux and Windows containers on Windows Server (assuming you’ve read the previous segments. Let’s get Started.

How to Install Docker Enterprise Edition Preview on Windows Server 2019

In prepping for this article, I started with a freshly installed Windows Server 2019 box. I used the GA Evaluation media to install the OS, then I upgraded to the latest Nov. build using Windows Update. In our previous segments we installed the Community edition of Docker. For this particular feature, we need to install Docker Enterprise Edition and the preview release at that.

First off, if you’re using the same box as you did in previous segments you’ll want to remove the version of Docker we installed with the DockerMSFTProvider in PowerShell.

NOTE: If you’re starting with a fresh server you can skip this step.

To Remove the previous version of Docker run the below command in an elevated PowerShell window:

Uninstall-Package -Name docker -ProviderName DockerMSFTProvider

Then reboot the box.

Now that we have a clean slate we can install the needed version of Docker to run Linux Containers. You can walk through the how-to below, or scroll down to watch the video.

NOTE: We’re going to be installing a testing build of the docker engine. While it’s fine for testing and learning, I would highly suggest waiting until a stable version is released prior to using it in production.

NOTE: It is required to have the Hyper-V Role installed in order to install the Docker Enterprise Edition preview. If this is a testing VM, make sure you enable nested virtualization.

To install the current preview build of Docker Enterprise Edition we need to run the below:

Install-Module DockerProvider

Then

Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview

Reboot your machine once again.

See it in action!

Installing_DockerEE.gif

 

How to Configure Docker Enterprise Edition to Run Linux Containers

Out of the box, this install of Docker will run Windows Containers. In order to switch back and forth between Windows and Linux containers you need to run the below commands:

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

To switch to Linux Containers

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
Restart-Service docker

To switch back to Windows Containers

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", $null, "Machine")
Restart-Service docker

Simply switch to whichever mode meets your needs at the given time.

Running Linux Containers on Windows Server 2019

After installing the Docker Enterprise Edition Preview and configuring it to run Linux containers we can use some of the syntax that we covered in previous sections to pull and run a container

Assuming you’ve switch to Linux mode, the below should work. Let’s first pull the latest Debian Linux container image:

NOTE: You can walk through the how to below, or scroll down to watch the video

Docker pull Debian

Then let’s run it in interactive mode and run a text-based app really quick just to make sure it works.

Docker run -it --name Debian_test Debian

Once in the prompt running the below will show us which version of the linux kernel is in use

Uname -r

Finally let’s install elinks, a text based web browser, using Debian’s packaging utility Apt

Apt-get update

Apt-get install elinks

Then let’s open google in elinks:

Elinks https://www.google.com

Hopefully, it should be working!

See it in Action!

Debian_Container_Test.gif

 

Wrap-Up

There you have it! You’ve successfully run a Linux container on top of Windows Server 2019. Pairing this with what we’ve done in the previous segments should have you prepared to run both Windows and Linux containers with docker. Knowing this, we’ll cover just a few more advanced docker items in the next post before getting into container orchestrators.

If you had troubles with this or have questions on use-case, or just have a general comment, be sure to let me know in the comments section below!

Until next time!

 

[출처] https://www.altaro.com/msp-dojo/linux-containers-windows-server-2019/

 

 

 

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
1040 [一日30分 인생승리의 학습법] 짱 멋진 "머신러닝 라이브러리" 정리 file 졸리운_곰 2021.08.27 110
1039 Gitlab - SSL 적용 file 졸리운_곰 2021.08.27 30
1038 git 에서 https repository 연결시 SSL 인증서 오류 해결법 file 졸리운_곰 2021.08.27 858
1037 [GIT] Conflict(충돌) 났을 때 강제로 Pull 하기. 졸리운_곰 2021.08.24 43
» [一日30分 인생승리의 학습법] How to Run : Linux Containers on Windows Server 2019 file 졸리운_곰 2021.08.07 45
1035 [一日30分 인생승리의 학습법] [Tensorflow] Serving이용하여 REST API 만들기 file 졸리운_곰 2021.08.07 38
1034 [一日30分 인생승리의 학습법] Amazon SageMaker는 처음이지? 누워서 머신러닝 학습부터 배포까지 file 졸리운_곰 2021.08.05 54
1033 [一日30分 인생승리의 학습법] Apache Beam (Dataflow)를 이용하여, 이미지 파일을 tfrecord로 컨버팅 하기 file 졸리운_곰 2021.08.04 49
1032 [一日30分 인생승리의 학습법] [GCP] Apache Beam 사용하기 file 졸리운_곰 2021.08.04 39
1031 [一日30分 인생승리의 학습법] Apache Beam, Apache Airflow, Apache Atlas 설명 졸리운_곰 2021.08.04 35
1030 [一日30分 인생승리의 학습법] 블레이저 웹어셈블리 (web assembly, WASM_ Awesome Blazor ) 놀라운 오픈소스 리스트 (open source) file 졸리운_곰 2021.08.04 5174
1029 MarkDown 사용법 총정리 file 졸리운_곰 2021.07.29 66
1028 [一日30分 인생승리의 학습법] [JWT/JSON Web Token] 로그인 / 인증에서 Token 사용하기 file 졸리운_곰 2021.07.24 39
1027 [一日30分 인생승리의 학습법] JWT(JSON Web Token)을 이용한 API 인증 - #1 개념 소개 file 졸리운_곰 2021.07.24 43
1026 [一日30分 인생승리의 학습법] XPath 란 무엇입니까? file 졸리운_곰 2021.07.24 25
1025 [一日30分 인생승리의 학습법] XPATH 사용법·작성법 file 졸리운_곰 2021.07.24 40
1024 [Git] Github에 잘못 올라간 파일 삭제하기 졸리운_곰 2021.07.13 41
1023 [一日30分 인생승리의 학습법]AI 한국어 자연어 처리 데이터셋 목록 file 졸리운_곰 2021.07.10 45
1022 [一日30分 인생승리의 학습법] 기계독해, MRC란 무엇일까 file 졸리운_곰 2021.07.10 59
1021 [一日30分 인생승리의 학습법] 웹어셈블리를 활용한 유망한 프로그래밍 언어 프로젝트 10가지 졸리운_곰 2021.07.02 34
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED