Windows docker 图像卷持久性 - 冒号路径问题

Windows docker image volume persistance - colon path issue

我正在尝试生成一个 windows 图像,它在 windows 用户配置文件文件夹中创建并保存卷数据。数据是按用户收集的,因此必须取决于用户个人资料。进行网上找到的所有更改,总是会出现图像中的错误。可能是什么问题?本地机器 env 保存值;我已经通过 Powershell 交叉检查了 env 变量值。

volumes:
      - ./devops/https/ngtcert.pfx:/https/aspnetapp.pfx:ro
      - "${USERPROFILE}/source/:${USERPROFILE}/source/"

图像希望创建一个源文件夹,或者创建或保留现有数据。

但是,我无法解决这个问题。

谢谢大家

关键问题是

  1. user: "ContainerAdministrator" 不见了。当运行一个windowsdocker。应提及用户。
  2. 文件夹路径应为windows格式

services:
  directoryservice:
    user:  "ContainerAdministrator"
    # build:
    #   context: .
    #   dockerfile: api-win.Dockerfile
    # image: apiwin:latest
    image: abcd.azurecr.io/api-windows:113133
    ports:
      - "44309:44309"
    environment:
      - COMPOSE_CONVERT_WINDOWS_PATHS=1
      - ASPNETCORE_ENVIRONMENT=Production
      - ASPNETCORE_Kestrel__Certificates__Default__Password=123#
      - ASPNETCORE_Kestrel__Certificates__Default__Path=C:\https\apicert.pfx
    volumes:
      - ./devops/https:C:\https:ro
      - ${USERPROFILE}\source:C:\source:rw```