简体   繁体   English

在Docker容器中运行Windows Server Core

[英]Running Windows Server Core in Docker Container

my Linux containers run like a charm, but the change to Windows Server in my Docker container makes me crazy! 我的Linux容器运行时很吸引人,但是Docker容器中对Windows Server的更改使我发疯了!

My Docker file doesn't build although it is as simple as my linux Dockerfiles: 尽管它与Linux Dockerfile一样简单,但我的Docker文件没有构建:

FROM microsoft/windowsservercore

#Install Chocolately
RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex)" 
ENV PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin 

#Install python
RUN choco install -fy python2
RUN refreshenv
ENV PYTHONIOINPUT=UTF-8

RUN pip install -y scipy

Some times I was able to Chocolately which results in a fail to install scipy via PIP or curiously starting 5 minutes ago, even the installation of chocolately fails: 有时候,我能够进行Chocolately操作,这导致无法通过PIP安装scipy,或者奇怪地在5分钟前开始,即使Chocolately安装也失败了:

iwr : The remote name could not be resolved: 'chocolatey.org'
At line:1 char:2
+ (iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex)
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt
   pWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
   ll.Commands.InvokeWebRequestCommand

Here are some specs on my Docker for Windows Installation: 这是我的Windows版Docker安装的一些规格:

Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 3
Server Version: 1.13.0
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 14393 (14393.693.amd64fre.rs1_release.1612
Operating System: Windows 10 Education
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.903 GiB
Name: xxxx
ID: deleted 
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 18
 System Time: 2017-01-31T16:14:36.3753129+01:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Any ideas? 有任何想法吗?

I was unable to get refreshenv to work, so I used multiple powershell sessions, I've included in case it is useful to someone in the future. 我无法使refreshenv正常工作,因此我使用了多个powershell会话,其中包括以防将来对某人有用。

#Install Chocolately, Python and Python Package Manager, each PowerShell session will reload the PATH from previous step
RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex" 
RUN @powershell -NoProfile -ExecutionPolicy unrestricted -Command "choco install -y python3"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows 客户端无法与在 linux docker 容器中运行的服务器通信 - Windows client can't communicate with server running in linux docker container 在 Windows Server 2019 上安装 Scrapy,在 Docker 容器中运行 - Install Scrapy on Windows Server 2019, running in a Docker container 运行在 docker 容器上的访问服务器 - Access server running on docker container 连接到在boot2docker中运行的python服务器时出错(centos容器| Windows 7.1主机) - Error connecting to python server running in boot2docker (centos container | Windows 7.1 host) 在Docker容器中运行的Python UDP服务器 - Python UDP server running in Docker container 运行python的Windows Docker容器中的证书验证错误 - Certificate Verification Error in Windows Docker container running python 从 Docker 容器中运行的 Python 代码访问 Windows CIFS 共享 - Accessing a Windows CIFS share from Python code running in a Docker container 在 docker 容器上运行 Tkinter - Running Tkinter on docker container 如何从其他机器访问服务器(在docker容器中运行)? - How to access a server(which is running in a docker container) from other machine? 在 Docker 容器内运行 uwsgi - 来自服务器的空回复 - Running uwsgi inside a Docker container - Empty reply from server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM