I’ve got YSQL working with one of the containers by first finding out the IP address of the container using:
sudo docker inspect -f ‘{{range.NetworkSetting.Networks}}{{.IPAddress}}{{end}}’ yb1
then:
docker exec -it yb1 /home/yugabyte/bin/ysqlsh –echo-queries -h (IP address)
Credits to this previous forum topic: Ysqlsh: could not connect to server: Connection refused - General - Yugabyte Community Forum
Feel stupid that it took me so long to figure out!