Windows 2019
Sponsored Link

Docker : Use Persistent Storage
When Container is removed, data in it are also lost, so it's necessary to use external filesystem in Container as persistent storage if you need.
[2] It's possible to mount any folders on parent Docker Host as external storage in Containers.
On this example, use a Container image with IIS created like here.
# create a folder for storing datas

PS C:\Users\Administrator>
mkdir C:\docker-storage
# create a test file

PS C:\Users\Administrator>
Write-Output 'Docker Persistent Storage Test' | Out-File -Encoding default C:\docker-storage\index.html
# start Container and mount the folder above on [C:\inetpub\wwwroot] in Container

PS C:\Users\Administrator>
docker run -t -d -p 8081:80 -v C:\docker-storage:C:\inetpub\wwwroot iis_server

PS C:\Users\Administrator>
docker ps

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
89c9a468c505        iis_server          "cmd"               7 seconds ago       Up 4 seconds>80/tcp   mystifying_meitner

# verisy accesses to mount normally

PS C:\Users\Administrator>
curl.exe localhost:8081

Docker Persistent Storage Test
Matched Content