Post
Topic
Board Development & Technical Discussion
Re: How to connect docker container to bitcoin node?
by
ETFbitcoin
on 14/10/2022, 09:04:06 UTC
when I make call to this script I get this error in return [Errno 111] Connection refused

Ps: when I run the same script outside of docker container it works fine Any solutions??

I only use docker to run certain application, but AFAIK you got this error because you didn't perform port forwarding. On terminal, i'd use parameter -p HOST_PORT:CONTAINER_PORT (should be -p 8332:8332 in your case) to perform port forwarding. But i don't know the equivalent for Dockerfile.

++ is it safe to run the node and connect to it using a script like this? locally?

Since you're the one who create the script, it should be safe. But if you have very serious security concern or writing script for business/enterprise usage, i'd recommend you to check whether library you use is malicious or not.