This repository has been archived by the owner on May 31, 2019. It is now read-only.
Save Data protection keys even after container is destroyed #303
Labels
closed-external
Closed because the issue is external to the project in this repo.
Copied from dotnet/dotnet-docker#295 by @VenkateshSrini
Steps to reproduce the issue
docker run -p 5000:80 --name containerda containerda-img
Expected behavior
Should run with out any warning.
Actual behavior
I get an warning saying
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container
. Protected data will be unavailable when container is destroyed.
Additional information (e.g. issue happens only occasionally)
Output of
docker version
I need a method to persist these keys even when the container is destroyed
Copied from dotnet/dotnet-docker#295 (comment) by @natemcmaster
Seems like a good candidate for aspnetcore documentation. https://github.com/aspnet/docs There are some docs already, but none for docker-specific scenarios.
Basically, you'll need to store the keys in a folder that is docker volume (i.e. shared volme or a host mounted volume), or you'll need to store them in an external provider, like Azure Key Vault or Redis.
cref aspnet/DataProtection#185
_Copied from dotnet/dotnet-docker#295 (comment) by @VenkateshSrini
@natemcmaster,
I have tried to mount a volume like this
docker run -v d:/venkatesh/aspnetcore/2.0/containerdasample/publish/containerapp/keys:/root/.aspnet/dataprotection-keys -p 5000:80 --name containerda containerda-img
In this I would expect the key to be stored in mounted volume but even after that I keep getting this error. I do not want to loose the encryption key. Can you please share me some link that has sample solution to this problem
The text was updated successfully, but these errors were encountered: