我一直在寻找任何证书管理器的这张图片,但我找不到任何可以帮助我安装 .cer 证书的东西。1709 nanoserver 映像不附带 powershell,因此为了使用它,我必须使用 microsoft/windowsservercore 映像进行多阶段构建,但我不太确定如何去做,我可以似乎没有通过谷歌找到任何有帮助的东西。
如果有人知道使用或不使用多阶段构建来安装证书的方法,将不胜感激。
对于那些感兴趣的人,这是我的 docker-compose.yml 和 Dockerfile
码头工人-compose.yml
version: '3'
services:
myapp:
image: myapp
ports:
- "5000:80"
build:
context: .
dockerfile: MyApp\Dockerfile
container_name: "myapp"
hostname: "myapp"
depends_on:
- db
db:
image: "microsoft/mssql-server-windows-express"
environment:
SA_PASSWORD: ""
ACCEPT_EULA: "Y"
container_name: "myapp"
hostname: "myapp"
Dockerfile
FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
WORKDIR /src
COPY MyApp.sln ./
COPY MyApp/MyApp.csproj MyApp/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/MyApp
RUN dotnet restore
RUN dotnet ef database update
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "MyApp.dll"]
谢谢!