Docker setup - using persistent volumes results in 2 issues

Problem 1) Following the instructions verbatim results in not using the persistent volume

Following the docker setup for linux containers for Persistent Data, from the documentation
results in the data not being stored in the persistent volume.

docker run --name powershelluniversal --mount source=psudata,target=/data --rm -d -p 5000:5000/tcp universal-persistent:latest

this command results in mounting the ‘psudata’ to /data not /home/data, thus preventing it from being persistent.

Problem 2) if i try to fix it by updating the run command , it doesn’t use the correct folder starting on the second startup:

if i change the run command to use
target=/home/data
it does work, it does populate, I can put in the license file and it shows in /home/data/Repository/.universal/license.ps1

  • reboot the image, the admin panel says ‘no license’
  • /home/data/Repository/.universal/license.ps1 still exists in the volume
  • re-upload license.
  • this time it’s created it here:
  • /home/data/Repository/data/Repository/.universal/license.ps1

you can remove my other post on this, since the first post’s subject and body were chasing down a red herring .

I figured i’d make this thread that gives the direct issue and information so that others can reference it.

I got it to work locally by doing the following:

FROM ironmansoftware/universal:latest
LABEL description="Universal - The ultimate platform for building web-based IT Tools" 

EXPOSE 5000
VOLUME ["/home/data"]
ENV Data__RepositoryPath /home/data/Repository
ENV Data__ConnectionString /home/data/database.db
ENV UniversalDashboard__AssetsFolder /home/data/UniversalDashboard 
ENV Logging__Path /home/data/logs/log.txt
ENTRYPOINT ["./Universal/Universal.Server"]
docker build . --tag=universal-persistent
docker run -it --name powershelluniversal --mount source=psudata,target=/home/data --rm -d  -p 5000:5000/tcp universal-persistent:latest

I adjusted the pathing to make up for the change we made with WORKDIR. I will update the documentation accordingly if this works for you as well.

Can confirm. This is working.