I've only been using Docker Desktop for a couple of days, so I'm still figuring things out. I have Pi-hole running with Unbound in a Docker container, and I want to ensure it restarts automatically if anything happens. When I go into the terminal for the Pi-hole container and try running the command `docker update --restart unless-stopped Pi-hole_2`, I get an error saying `/bin/sh: docker: not found`. I'm confused because it seems like none of the commands are working in this terminal. I even installed Ubuntu 24.04 thinking I needed a different setup. Can anyone help me understand what I'm doing wrong? I have Unraid too, and the terminal for each Docker works fine there.
2 Answers
Exactly! When you open the terminal in Docker for a specific container, you’re in that container’s shell, not the host's. You need to go back to your main terminal or command line interface on your host where Docker is actually installed, then run your `docker update` command there.
It sounds like you're trying to run Docker commands inside your Docker container, which won't work. Docker commands can only be run from the host system where Docker is installed. So, you need to exit the Pi-hole container's terminal and run your command from the Docker Desktop console on your host machine instead.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures