Docker image not working

Hi Matt,

I created the folder like so:

/Users/stevenspierenburg/Temp/docker/volumes/psu

This is the yaml file as instructed. I did change the portnumber though as port 80 is occupied.

---
version: "3"
services:
  PowershellUniversal:
  container_name: PowershellUniversal
  image: ironmansoftware/universal:3.7.14-ubuntu-20.04
  restart: unless-stopped
  volumes:
    - /Users/stevenspierenburg/Temp/docker/volumes/psu:/root
  ports:
    - "6002:5000"

(not sure about the 3 dashes on top of the yaml file but I took them as they are present in the example you gave)

Everytime I try to use ‘compose’ I get this:

docker compose up -d
services.volumes must be a mapping

docker compose up -d
services.ports must be a mapping

docker % docker compose up -d
services.restart must be a mapping

docker compose up -d
services.PowershellUniversal must be a mapping

Every time I run the compose command I get another output, it seems to cycle between all the ‘issues’ it finds?

Hi Adam,

Let me know if you need something from my end to test or try.

Apologies @adam, I did not see your message before I posted “That all seams to be working”.

@Steven,

the dashes at the top are needed.

Everything below the line PowershellUniversal: needs to be indented out. the same error happened on my device until i spotted that.

2023-03-06 18_46_27-Window

Once i changed that my container started.

Let me know how that goes

Hi Matt,

Did the indent and that helped getting compose running:

docker compose up -d
[+] Running 2/0
⠿ Network docker_default Created 0.0s
[+] Running 1/3wershellUniversal ⠿ Network docker_default Created 0.0sux/amd64) does not match the detected host platform (linux/arm[+] Running 1/3wershellUniversal ⠿ Network docker_default Created 0.0sux/amd64) does not match the detected host platform (linux/arm[+] Running 2/3wershellUniversal ⠿ Network docker_default Created 0.0sux/amd64) does not match the detected host platform (linux/arm ⠿ Container PowershellUniversal Started 0.3s
⠸ PowershellUniversal The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s

When navigating to http://localhost:6002 I see no responses:

This page isn’t working
localhost didn’t send any data.
ERR_EMPTY_RESPONSE

Looking at Docker Desktop and the log of the container running:

023-03-06 21:53:05 PowershellUniversal | [20:53:05 FTL] Fatal error starting PowerShell Universal.
2023-03-06 21:53:05 PowershellUniversal | System.IO.IOException: Function not implemented
2023-03-06 21:53:05 PowershellUniversal | at System.IO.FileSystemWatcher.StartRaisingEvents()
2023-03-06 21:53:05 PowershellUniversal | at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
2023-03-06 21:53:05 PowershellUniversal | at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0()
2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer) 2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source) 2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder) 2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() 2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration() 2023-03-06 21:53:05 PowershellUniversal | at Microsoft.Extensions.Hosting.HostBuilder.Build() 2023-03-06 21:53:05 PowershellUniversal | at Universal.Server.Program.<>c__DisplayClass3_0.<Main>b__0(Options o) in C:\actions-runner\_work\universal\universal\src\Universal.Server\Program.cs:line 72 2023-03-06 21:53:06 PowershellUniversal | Unhandled exception. System.IO.IOException: Function not implemented 2023-03-06 21:53:06 PowershellUniversal | at System.IO.FileSystemWatcher.StartRaisingEvents() 2023-03-06 21:53:06 PowershellUniversal | at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed() 2023-03-06 21:53:06 PowershellUniversal | at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value) 2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher() 2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter) 2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter) 2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0() 2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer)
2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Configuration.FileConfigurationProvider…ctor(FileConfigurationSource source)
2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
2023-03-06 21:53:06 PowershellUniversal | at Microsoft.Extensions.Hosting.HostBuilder.Build()
2023-03-06 21:53:06 PowershellUniversal | at Universal.Server.Program.<>c__DisplayClass3_0.b__0(Options o) in C:\actions-runner_work\universal\universal\src\Universal.Server\Program.cs:line 72
2023-03-06 21:53:06 PowershellUniversal | at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action)
2023-03-06 21:53:06 PowershellUniversal | at Universal.Server.Program.Main(String args) in C:\actions-runner_work\universal\universal\src\Universal.Server\Program.cs:line 52
2023-03-06 21:53:06 PowershellUniversal | qemu: uncaught target signal 6 (Aborted) - core dumped

Hey @Steven

Are you running a mac with an m1 chip?

thanks

Hi Chris,

Yes I am. Heres all the info relevant. If you need more I’m happy to oblige.

Try this: Install Docker Desktop on Mac

After installing… I was able to run PSU container.

softwareupdate --install-rosetta

Hi Chris,

Thanks for the help.

I installed the M1 / Mac with Apple silicon before, I started out with that version/type.

I did run the command you suggested:

softwareupdate --install-rosetta

I still get the error in the logs after starting either my own or the one from the repository.

Fatal error starting PowerShell Universal.
2023-03-06 23:07:50 System.IO.IOException: Function not implemented

Maybe I need to uninstall and re-install everything?

You can try. Did Rosetta get install successfully. Rebuild and run the container?

Hi Chris,

I did just now re-build the Container
First I removed all Images and Containers I had and closed Docker Desktop.
Then ran:

docker system prune

Then ran Rosetta isnatall again:

softwareupdate --install-rosetta

Outcome was:

softwareupdate[2666:22215] Package Authoring Error: 032-48321: Package reference >com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute

Install of Rosetta 2 finished successfully

Started the Image wich resulted in a Container and the log of that container said:
Fatal error starting PowerShell Universal.

2023-03-07 08:29:28 System.IO.IOException: Function not implemented
2023-03-07 08:29:28 at System.IO.FileSystemWatcher.StartRaisingEvents()
2023-03-07 08:29:28 at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()

I’m sorry for all the problems, this is not easy it seems. Not sure what I am doing wrong…

@Steven,

Can you try to install colima and try to start the container again?

brew install colima
colima start

abiosoft/colima: Container runtimes on macOS (and Linux) with minimal setup (github.com)

Hi Chris,

I uninstalled Docker Desktop and installed Colima.

I ran the docker build and docker run commands and there is a container running, I just cannot access it and I have no clue where to look for a log. Docker Desktop showed me the log and errors in there. As I had to de-install Docker Desktop I no longer have that luxury.

Seems this should be able to run and installing all these tools makes me think this is not the right way, else the guide from Adam would have mentioned these things as a pre-requisite.

And I must be honest here, I have no clue what I am doing in regards with Colima or Rosetta and which would maybe help out.

@adam : can you help here? Is this docker image supposed to be able to run on MacOS as host? The error messages posted above all call out some function/method not being available.

Above all I want to avoid wasting everybody’s time if this image was never supposed to run on MacOS.

@Steven you need docker desktop as well as colima. Colima uses docker and is just the runtime for the docker containers… I am running psu on a M1 mac using docker and Colima.

Process:

  1. Install docker and docker desktop.
  2. Install Colima.
  3. Start colima. colima start
  4. Start the psu docker container.

I typically use this method when images are not compatible with the m1 chip, but see if this works for you.

System Version: macOS 13.2.1 (22D68)
Chip: Apple M1 Pro
colima list 

PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    x86_64    2       4GiB      60GiB    docker     
docker ps

CONTAINER ID   IMAGE                         COMMAND                  CREATED              STATUS              PORTS                                       NAMES
ad3117b52f63   universal-persistent:latest   "./Universal/Univers…"   About a minute ago   Up About a minute   0.0.0.0:5000->5000/tcp, :::5000->5000/tcp   powershelluniversal

Hi Chris,

I downloade dthe silicon version of Docker Desktop and installed it again.
Removed all images and Containers and ran the docker build again.

Docker Desktop shows neither the Image nor the Container.

colima list             
PROFILE    STATUS     ARCH       CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    aarch64    2       2GiB      60GiB    docker

I see that “ARCH” output is different from yours, is that significant perhaps?

Maybe…

You can try and start colima with a different ARCH.

colima start --arch x86_64

Hi Chris,

I did that, and I have no idea if it worked or what the error might be if not working.
The Container seems to be running but I cannot check or do not know how to check.

I did do this command as I got an error running the image:

lsof -iTCP:6002 -iUDP:6002 -n -P

COMMAND  PID              USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ssh     3058 stevenspierenburg   16u  IPv4 0x670cdcec06e29365      0t0  TCP *:6002 (LISTEN)

No idea why this port 6002 is all of a sudden “ssh”?

Trying to run the image:

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

Results:

docker: Cannot connect to the Docker daemon at unix:///Users/stevenspierenburg/.colima/default/docker.sock. Is the docker daemon running?.
See ‘docker run --help’.

I have a feeling I am going downhill and getting bad results. This is supposed to be easy, if I understood this right, but this is increasingly more difficult. Did I break my system? Do I need to undo what I installed or set?

I’m sorry, I must sound like a whiner and in a way I am. This is so frustrating and makes me think: am I too invested in this PSU as solution? Should I look around and find another product that fights me a little less? So I must sound like a whiner and I apologise for it.

And before I buy this product, I have some doubts about these issues and start to wonder if support is better if paid for it. I suppose it is, makes sense. But buying a product where I face immediate blockades and no resolution in sight does not make for a good start.

I can see now that the issue of

Cannot connect to the Docker daemon at unix:///Users/stevenspierenburg/.colima/default/docker.sock. Is the docker daemon running?

Was due to Colima not running at that moment.

I removed everything, re-installed Docker and threw away the older image and re-build the image.

I used:

docker build . --tag=universal-persistent

The dockerfile contains:

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

The run command is:

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

Still nothing in the browser to acces though. Where do I need to look for the log files to investigate?

Hi @Steven,

Once you have your M1 chip issues sorted, that compose script I posted should work.

According to your build config above you are exposing port 5000 which is correct, however when you go to run your built container you pipe port 6002 to 6002 which is not exposed.

Please note that your build is only rebuilding whatever Adam has already built in his published docker images.

I can also see that your storage is mounted to psudata. Have you created a storage mount in docker called psudata? Otherwise, you should be able to replace that with a folder path.

Hi Matt,

I thought I had to stay away from the EXPOSE in the dockerfile because Adam already ‘did something’?

Can you tell me what is the right way to start this all? Do I need a dockerfile? Do I need to assign ports?
And storage, no idea. I want to start simple, effectively have it working and then work my way up to more complex issues, like storage. We can omit if that is better?

I cannot use port 5000 as that is already claimed by a core process in MacOS.