This page provides installation and configuration information for Docker.
Docker
Confirming Docker is installed correctly
NOTE: Note: Apple M1 devices: At the time of writing there are some issues on Apple M1 devices and, some ARM64/ARMv8 devices. Please review this forum thread before proceeding.
Docker
Run the following command to confirm Docker is installed:
docker version
Example Output:
Client: Docker Engine - Community
Version: 23.0.1
API version: 1.42
Go version: go1.19.5
Git commit: a5ee5b1
Built: Thu Feb 9 19:47:01 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 23.0.1
API version: 1.42 (minimum version 1.12)
Go version: go1.19.5
Git commit: bc3805a
Built: Thu Feb 9 19:47:01 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Docker Compose
Docker Compose v1 uses the command docker-compose. As of June 2023 support ends for Docker Compose v1.
Docker Compose v2 uses the command docker compose.
If you are using Docker Compose v1 please adjust the commands accoridingly. More infromation on Docker Compose can be found here.
Run one of the following commands to check Docker Compose is installed:
Docker Compose v1:
docker-compose version
Docker Compose v2:
docker compose version
Example Output:
Docker Compose version v2.16.0
A Docker Hello-World
To ensure that Docker has the ability to pull and run container images run the following command:
docker run hello-world
Example Output:
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
Installation
Using the pre-built Container
In order to run PowerShell Universal, you can use the provided container image. The docker image is available on Docker Hub .
The prebuilt version allows you to run all free and paid features of PowerShell Universal.
You can start the container by pulling the image and then running a container with the default port bound.
In some cases, you may wish to build more features, modify, or hardcode Environment Variables into your container.
For that, you will need to Create a Dockerfile
NOTE: Dockerfiles' are case-sensitive and must start with a capital 'D'.
To create a Docker image that can persist the Universal data, you can create a dockerfile like the one below.
This Dockerfile exposes port 5000, creates a /data volume, sets configuration environment variables to store the Universal repository and database in the volume and then sets the Universal.Server as the entry point to the container.
Writing a Dockerfile script for Linux
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"]
Building a container
From the path your Dockerfile is hosted in run the following command:
docker build . --tag=universal-persistent
Windows
FROM ironmansoftware/universal:1.3.1-windowsservercore-1809
LABEL description="Universal - The ultimate platform for building web-based IT Tools"
EXPOSE 5000
VOLUME ["C:/data"]
ENV Data__RepositoryPath C:/data/Repository
ENV Data__ConnectionString C:/data/database.db
ENV UniversalDashboard__AssetsFolder C:/data/UniversalDashboard
ENV Logging__Path C:/data/logs/log.txt
ENTRYPOINT ["C:/ProgramData/Universal/Universal.Server.exe"]
You can run a build with the build command.
docker build . --tag=universal-persistent
You can start the docker container with the run command and make sure to specify the volume to mount.
To properly support time zones on Linux when scheduling jobs, you will need to include the tzdata package in your dockerfile along with an environment variable that specifies the server time zone.
ENV TZ Europe/Amsterdam
RUN apt-get install -y tzdata
Summary
This has been a very basic "How get get started" which allows you to get started running or building PSU Containers. All souces for commands have been linked in the referances session.