You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


윈도우 도커를 추가하여,도커 내에서 IIS와 Net45를 이용하는 웹서비스 구동이 가능할까?

물론 가능하다.  

OS 설치정보

Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vbguest.auto_update = false
  config.vm.box = "StefanScherer/windows_2019_docker"
  config.vm.hostname = "docker3"
  config.vm.network "private_network", ip: "192.168.56.203"
  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
     vb.memory = "2048"
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end


윈도우(닷넷45) 기능을 이용할수 있는 Dockerfile

Dockerfile
FROM microsoft/iis:10.0.14393.206
MAINTAINER alexellis2@gmail.com


SHELL ["powershell"]

RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \
    Install-WindowsFeature Web-Asp-Net45

COPY VoteService VoteService
RUN Remove-WebSite -Name 'Default Web Site'
RUN New-Website -Name 'VoteService' -Port 80 \
    -PhysicalPath 'c:\VoteService' -ApplicationPool '.NET v4.5'
EXPOSE 80

CMD Write-Host IIS Started... ; \
    while ($true) { Start-Sleep -Seconds 3600 }



윈도우 HOST에서 Docker 구동 모습

여기 샘플은 

docker1,2는 리눅스이고 docker3는 윈도우 호스트로 셋팅하였다.

ssh가 기본으로 작동이 안되며, power shell 또한 VM을 구동하는 Host가 윈도우여만 하기때문에

Rancher Agent 설치를 VM을 이용하여 GUI 화면을 직접 이용해서 설치가하다. Rancher Agent 설치후에는 웹에서 컨테이너 제어가 가능하기때문에 이 화면을 접근할일은 없을것이다. 





  • No labels