Blynk Server successfully started.
All server output is stored in folder ‘/home/pi/logs’ file.
Then I try:
pi@raspberrypi:~ $ docker run -p 8080:8080 -p 9444:9443 mpherg/blynk-server
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.
and tried with sudo:
sudo docker run -p 8080:8080 -p 9444:9443 mpherg/blynk-server
docker: Error response from daemon: driver failed programming external connectivity on endpoint friendly_carson (d58e16b50ac497a062722a232a5b2a8438e3f86a6d9c746ae4a1606995674971): Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already in use.
ERRO error waiting for container: context canceled
sure, the first error is a simple permission issue - you’re user pi probably does not belong to the docker group and thus is unable to access docker unix socket.
You figured it out by using sudo.
The other error is now complaining about the other port 8080 - to overcome this, you want to map this to other port too.
Anyway, from your description I have no idea what you’re trying to achieve.
Why are you starting up 2 servers?
The first one you started with the java command took the ports (8080, 9443), so obviously, the docker is unable to map the internal ports to them.
either use -p 8081:8080 -p 9444:9443 or just don’t run the first server using java.
so, I think a takeaway from your post is that I can’t start the blynk server and run the docker container at the same time. In other words I should be able to stop the blynk server and start it via the docker container. Is this the right way to think about it.
As you can surmise I am new to this and don’t really know wtf I’m doing.
you have 2 options on how to run the server - directly by running java, or dockerized, where the java is ran from the container.
If you happen to need multiple blynk servers running on the same machine, you got to make them use unique ports.