Problem/Justification
When I stop an app through the web UI, it appears to actually remove the underlying app from the system itself. If I run “docker ps”, the stopped app doesn’t show up. This works if I stop the app from the CLI with docker, but the app shows as “crashed” in the web UI. This makes it more difficult to automate applications with docker commands.
Impact
With the app still available through the docker CLI commands, it allows for more automation opportunities without having to go through truenas middleware to implement.
User Story
I could use scripts to start and stop apps based on certain criteria. It also allows for better insights of all apps currently on the system even if they aren’t showing through docker ps.
Another item on top of this, I have a plex container with a static IP in a docker network bridge so it works properly with the plex.direct url. When the container is stopped in truenas, it removes it completely from the docker stack causing the stack to assign the IP to other containers as needed. If the container was within the stack, but stopped, it would prevent the statically assigned IP from being assigned to other containers.
Do not issue plain docker commands for truenas apps, this breaks docker-compose they use internally. E.g. direct docker stop kills container bypassing compose project, which will show app as crashed. It is possible to check running projects (not containers) with docker compose ls and probably call docker compose up/down on them, though they also disappear from that list when stopped.
For your described goal midclt (installed and available to admin) would be better native solution:
# query without filter for all apps
# run without jq for more info
midclt call app.query '[["state", "=", "STOPPED"]]' | jq -r '.[] | .name' | sort
# or app.stop
midclt call app.start NAME
It would be great if the built in standard commands were maybe aliases or something so people familiar with basic docker commands could run the normal commands still, but they were translated to midclt calls on the backend.