我正在尝试从Windows容器运行旧版ASP.Net(.Net 4.7.1)应用程序。要求之一是将系统区域性,语言环境和位置设置为en-GB。我不允许触摸代码,如果绝对需要,只能触摸web.config。
考虑以下方法:
我的基本映像的Dockerfile是:
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2
ARG site_root=.
WORKDIR /scripts
COPY scripts/ .
RUN powershell -f install-certificates.ps1
RUN powershell C:/Windows/System32/inetsrv/appcmd.exe set config /commit:WEBROOT /section:globalization /culture:en-GB
RUN powershell C:/Windows/System32/inetsrv/appcmd.exe set config /commit:WEBROOT /section:globalization /uiCulture:en-GB
RUN powershell Set-Culture en-GB
RUN powershell Set-WinSystemLocale en-GB
RUN powershell Set-WinHomeLocation -GeoId 242
RUN powershell Set-WinUserLanguageList en-GB -Force
Run Code Online (Sandbox Code Playgroud)
然后构建并运行容器。
docker build -t tmpaspnet .
docker run -it --name tmpcontainer --entrypoint powershell tmpaspnet
# inside the container
Restart-Computer
# container will exit, wait …Run Code Online (Sandbox Code Playgroud) What is the correct way for multiple Windows containers running a .net core application to trust each other's HTTPS certificates?
I have the following setup:
Container A is running a REST service which is required by Container BContainer B calls the REST service with an HttpClientContainer B does something with the resultThe problem is, that when B calls A, I got a The remote certificate is invalid according to the validation procedure. exception. This is the …
我正在尝试创建一个 Dockerfile,将本地 Windows 文件系统上某处的文件夹添加到 Windows 容器中。但是,我很难找出正确的语法。
具体来说,我尝试将目录 [C:\Foo Source Files\Zog Foo\Bar] 的内容复制到 Windows Docker 容器中的 [C:\Bar]。
到目前为止,我已经尝试了以下变体:
ADD ["C:\Foo Source Files\Zog Foo\Bar", "C:/Bar"]
ADD ["C:\Foo Source Files\Zog Foo\Bar\", "C:/Bar/"]
Run Code Online (Sandbox Code Playgroud)
当尝试运行构建映像时,这些导致出现以下错误:
failed to process "[\"C:\\Foo": unexpected end of statement while looking for matching double-quote
Run Code Online (Sandbox Code Playgroud)
相比之下,以下变体...
ADD ["C:/Foo Source Files/Zog Foo/Bar", "C:/Bar"]
ADD ["C:/Foo Source Files/Zog Foo/Bar/", "C:/Bar/"]
ADD ["C:\\Foo Source Files\\Zog Foo\\Bar\\", "C:/Bar/"]
ADD ["C:\\\\Foo Source Files\\\\Zog Foo\\\\Bar\\\\", "C:/Bar/"]
ADD ["C:\\\\Foo Source Files\\\\Zog Foo\\\\Bar", "C:/Bar/"]
ADD C:/Foo Source Files/Zog Foo/Bar/, C:/Bar/ …Run Code Online (Sandbox Code Playgroud) 我正在Windows中使用最新版本的docker。linux容器运行顺利,但是我遇到了以下问题
wsarecv:现有连接被远程主机强行关闭。
发生这种情况是为了从存储库中获取某些特定图像。就我而言,我正在获取microsoft / aspnet。我创建了一个docker文件并尝试构建我的自定义映像。我已经按照存储库说明创建了一个docker文件。图片如下
在此状态后,我被远程主机错误强行关闭。
我的dockerfile内容是
FROM microsoft/aspnet:4.7
ARG site_root=.
ADD ${site_root} /inetpub/wwwroot
Run Code Online (Sandbox Code Playgroud) 我正在尝试从主机解析 docker 容器地址。Windows 主机。Windows 容器。我回顾了许多类似的问题:
这些问题都没有解决这个具体问题。看起来像是一个微不足道的操作,我根本不明白为什么它不起作用。
例如
$ docker network create -d nat --subnet 172.25.0.0/16 test-net
$ docker container run --network test-net --name example-1 test/example1
Run Code Online (Sandbox Code Playgroud)
其中 test/example1 只是一个 ASP.NET Core Web 服务器。
因此,在我看来,我应该能够根据我在上面引用的答案中看到的各种线索来解析主机的容器名称。例如
$ nslookup example-1 172.25.0.1
$ nslookup example-1 127.0.0.11
$ nslookup example-1.test-net.docker 127.0.0.11
Run Code Online (Sandbox Code Playgroud)
然而没有任何作用。
当然,我在生产中不需要这种功能,但它对于测试非常有帮助。我根本不明白为什么我不能让它发挥作用。我缺少什么?
我正在尝试在基于 image 的正在运行的 Windows 容器内安装 WixToolset 3.11.1 mcr.microsoft.com/windows/servercore。我正在使用 Chocolatey 命令choco install wixtoolset,但 .NET 3.5 无法安装并且安装被卡住。我尝试了相同的命令,将其添加到 Dockerfile 以在映像构建期间安装它,但错误是相同的。有没有办法将 wixtoolset 安装在 Windows 容器内,或者我在这个过程中遗漏了一些东西?
以下是我运行安装命令后的日志:
PS C:\> choco install -y -r --no-progress wixtoolset
Installing the following packages:
wixtoolset
By installing you accept licenses for the packages.
DotNet3.5 v3.5.20160716 [Approved]
dotnet3.5 package files install completed. Performing other installation steps.
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing …Run Code Online (Sandbox Code Playgroud) 我必须创建一个 Windows 容器映像,并在其中安装我们的应用程序。我们的应用程序在安装过程中在多个地方使用主机名。该docker build命令没有传递主机名的选项 - 因此我们目前陷入这样的境地:当我们运行创建了映像的容器时,我们的应用程序无法运行,因为它期望主机名是在运行期间生成的名称。图像创建时间,而不是我们传递给docker run命令的时间。
在安装我们的应用程序之前,我尝试使用此问题的建议更改容器内的主机名- 但它不起作用。
我想了解是否有办法可以从 Windows 容器内更改主机名。
我想在 Windows 容器中使用 WSL。我希望我的 shell 是 dockerfile 中的 bash.exe(来自 Wsl 功能)(我不想要 msys2/relatives,但是WSL 1)
我试过
FROM mcr.microsoft.com/windows:1903
RUN dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Run Code Online (Sandbox Code Playgroud)
没有成功。有人可以提示我使用金色的 dockerfile 吗?
我是 Containerd 的新手,我正在尝试使用 Containerd 运行 Windows 容器。安装 Containerd 后,我只是尝试从注册表中提取映像,但遇到了以下问题。我遇到的问题来自处理图像时的容器运行时 hcssshim::ProcessBaseLayer 方法。请帮助我解决问题。我正在使用containerd 1.6.0-rc.1(预发布)。我之所以使用它是因为我想尝试 Windows HostProcess 容器。PFB 问题。
PS C:\Program Files\containerd> .\crictl.exe pull mcr.microsoft.com/windows/nanoserver:20H2
time="2022-01-21T07:29:44Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"mcr.microsoft.com/windows/nanoserver:20H2\": failed to extract layer sha256:4370934b39e53babdf58bfe6ff2bcc662e068d3b71bd015ea280a402a89e6673: hcsshim::ProcessBaseLayer \\\\?\\C:\\ProgramData\\containerd\\root\\io.containerd.snapshotter.v1.windows\\snapshots\\12: The specified module could not be found.: unknown"
Run Code Online (Sandbox Code Playgroud) docker ×9
dockerfile ×3
build-tools ×1
containerd ×1
containers ×1
dns ×1
https ×1
installation ×1
shim ×1
sql-server ×1