admin管理员组文章数量:1334704
I have created docker file to import SSL certificate in IIS container. It throws some errors while building docker file.
Docker file I used
# escape=`
FROM mcr.microsoft/dotnet/framework/aspnet:4.8
# Enable Web Management Service and configure for remote management
RUN powershell Install-WindowsFeature Web-Mgmt-Service; `
New-ItemProperty -Path HKLM:\software\microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force; `
Set-Service -Name wmsvc -StartupType automatic
RUN net user iisadmin Password1 /ADD
RUN net localgroup administrators iisadmin /ADD
RUN powershell c: mkdir volume
RUN powershell c: mkdir /etc/ssl/certs/
COPY Designvaultprivatekey.pfx /etc/ssl/certs/
ARG PFX_PASSWORD=test123
# Import the PFX certificate using PowerShell
RUN powershell -Command "`
$ErrorActionPreference = 'Stop';
$password = ConvertTo-SecureString -String '$env:PFX_PASSWORD' -Force -AsPlainText;
Import-PfxCertificate -FilePath '/etc/ssl/certs/Designvaultprivatekey.pfx' -CertStoreLocation '/path/to/your/certificate/store' -Password $password;
`"
- Error I recived
Error response from daemon: dockerfile parse error on line 20: unknown instruction: $password
Use this command to run above docker file
docker build --build-arg PFX_PASSWORD=test123 -t (imagename) .
Can anybody provide some guidance on how to resolve the above issue and how to properly import the SSl certificate into the IIS windows container ?
I have created docker file to import SSL certificate in IIS container. It throws some errors while building docker file.
Docker file I used
# escape=`
FROM mcr.microsoft/dotnet/framework/aspnet:4.8
# Enable Web Management Service and configure for remote management
RUN powershell Install-WindowsFeature Web-Mgmt-Service; `
New-ItemProperty -Path HKLM:\software\microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force; `
Set-Service -Name wmsvc -StartupType automatic
RUN net user iisadmin Password1 /ADD
RUN net localgroup administrators iisadmin /ADD
RUN powershell c: mkdir volume
RUN powershell c: mkdir /etc/ssl/certs/
COPY Designvaultprivatekey.pfx /etc/ssl/certs/
ARG PFX_PASSWORD=test123
# Import the PFX certificate using PowerShell
RUN powershell -Command "`
$ErrorActionPreference = 'Stop';
$password = ConvertTo-SecureString -String '$env:PFX_PASSWORD' -Force -AsPlainText;
Import-PfxCertificate -FilePath '/etc/ssl/certs/Designvaultprivatekey.pfx' -CertStoreLocation '/path/to/your/certificate/store' -Password $password;
`"
- Error I recived
Error response from daemon: dockerfile parse error on line 20: unknown instruction: $password
Use this command to run above docker file
docker build --build-arg PFX_PASSWORD=test123 -t (imagename) .
Can anybody provide some guidance on how to resolve the above issue and how to properly import the SSl certificate into the IIS windows container ?
Share Improve this question asked Nov 20, 2024 at 6:00 sheiksheik 14 bronze badges1 Answer
Reset to default 0The previous line ($ErrorActionPreference = 'Stop';) is missing the ` character so the next line stays inside the PowerShell command.
本文标签: Unable to import SSL certificate into my IIS docker containerStack Overflow
版权声明:本文标题:Unable to import SSL certificate into my IIS docker container - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742378632a2463666.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论