在运行iis/php环境时,我遇到了一些问题,使用docker。事实上,有很多问题,但让我们从下面这个问题开始:)
我的机器是Windows10Pro周年纪念,而这个容器,是基于WindowsCore的。
我有一个powershell命令,如果我在容器中运行,它将更新默认文档,但不能从DockerFile中运行。
RUN powershell.exe -Command \
Import-module IISAdministration; \
Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" | Get-IISConfigCollection -CollectionName "files" | New-IISConfigCollectionElement -ConfigAttribute @{"Value" = "index2.php"}“‘Get IISConfigCollection”不被识别为内部或外部命令、可操作的程序或批处理文件。
但是,在容器中,以下命令可以正常工作:
Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" | Get-IISConfigCollection -CollectionName "files" | New-IISConfigCollectionElement -ConfigAttribute @{"Value" = "index2.php"}与此命令相关的问题:
Add-WebConfigurationProperty -Filter "//defaultDocument/files" -PSPath "IIS:\sites\mysite" -AtIndex 0 -Name "Collection" -Value "index2.php"它可以在我的主机上正常工作,但在容器中不能工作,在DockerFile中也不行。
所以..。
我需要在什么地方更新ps吗?
从DockerFile设置iis默认文档(第一个索引)的正确方法是什么。
谢谢
Docker版本信息:
> `PS E:\Docker> docker version
Client:
Version: 1.13.0-dev
API version: 1.25
Go version: go1.7.3
Git commit: 16bcc1a
Built: Fri Nov 4 08:04:41 2016
OS/Arch: windows/amd64
Server:
Version: 1.13.0-dev
API version: 1.25
Go version: go1.7.3
Git commit: 16bcc1a
Built: Fri Nov 4 08:04:41 2016
OS/Arch: windows/amd64
Experimental: false`发布于 2016-11-04 20:19:08
在对下列作品做了一些修改之后,有些东西在逃逸:
RUN powershell.exe -Command " \
Import-module WebAdministration; \
Get-IISConfigSection -SectionPath system.webServer/defaultDocument | Get-IISConfigCollection -CollectionName files | New-IISConfigCollectionElement -ConfigAttribute @{'Value' = 'index2.php'} "https://stackoverflow.com/questions/40427634
复制相似问题