mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1809 AS base issue with Config files in image/container RRS feed

  • Question

  • Hi

    I have an image based on   mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1809 AS base.  Its a asp.Net core 2.2 application and depends on 2 files connections.json and appsettings.json in the /app/configs folder.

    I am trying to use Docker Configs as part of docker swarm mode however we need the files in /app/configs to not be in the folder to setup the configs since symlinks are created with the same name.

    If I build the image/container with the files in the /app/Configs folder then the container will start.

    I can do a docker cp to copy new config files to this location but this defeats the purpose of having the docker config stored.

    When I do a docker exec -it container cmd.exe, I am not able to delete the files and get an access denied.   I am trying to delete the files to recreate an image without the files since it will throw an error with the files in place.

    When I build the image without the 2 files in the /app/configs folder, the container will not start up even though I am supplying the config details in the start.

    docker service create --name ServiceName --replicas 2 --publish 8090:80 --config src=appsettings.json,target=/app/configs/appsettings.json --config src=connections.json,target=/app/configs/connections.json  servicename:latest

    I get task failed to start and in the even logs I have this error.

    pulling image failed [service.id=vr60fjaum8mf91wze5e2xxggr module=node/agent/taskmanager node.id=032kcpya3vgf7o8l10qpbi9df task.id=ipf4l2nf6dxnm0rkzsuur67ha error=pull access denied for authservice, repository does not exist or may require 'docker login': denied: requested access to the resource is denied]

    I do have an authservice image that is loaded on the both the management/worker nodes that I copied over (docker image save to tar file, copy, docker image load).

    Could a dependency layer not be part of this tar file copy?    

    I am not sure why it would need to pull from external and require a docker login?

    Friday, October 11, 2019 5:03 PM