Persistent Docker Image

Create a persistent docker image of PowerShell Universal

Download this Lecture Docs

In this video, we look at how to create a persistent docker image and container using the PowerShell Universal docker image.

Example code and command lines from this video

dockerfile

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"]

Build Command Line

docker build . --tag=universal-persistent

Run Command Line

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