Hi, I’m trying to send a command in the terminal of one of my containers “my_container”:
sudo docker restart my_container
at first I got: bash: docker: command not found
So I installed a docker but now I keep getting these permission denied errors
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied
or
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
can you detail your scenario?
In which terminal are you trying? From your desktop OS’s terminal or one on balenaCloud dashboard?
Did you ssh to the device? With balena-cli or other way?
You should be able to restart the container from the balenaCloud dashboard by clicking the circular arrows Restart button at the end of the row in the services section.
You can restart the container with the help of the supervisor: Interacting with the balena Supervisor - Balena Documentation
In case you want to use docker commands you need to be in a terminal on the Host OS where the docker command is replaced with the balena command. For example to list the running containers you may run balena ps instead of “docker ps”
Hi,
I’m trying from Balena terminal, and I want to be able to send a command to restart, not through the button, in the container I’m trying to restart
This will only restart the service that you specified using serviceName. Note that you will also need to add the io.balena.features.supervisor-api label to the service in order to allow it to access the supervisor API.