
If you have created a docker image, say a Ubuntu base image with Apache Tomcat and you want to access Oracle/MySQL that has been installed on your local macOS/Windows system and you are wondering how to connect your device localhost from within the Docker container, then do the below,
Solution:Make use of host.docker.internal instead of using localhost or 127.0.0.1
Note: Works are using Docker v18.03 and above.
More Posts related to Docker,
- Install RabbitMQ on Docker
- How to know docker Engine details
- [fix] Docker: Alpine Linux - /bin/sh: bash: not found
- How to know list of images available on your device
- How to check installed docker version command
- [Docker] Install Python3 on Alpine Linux
- Install the minimal Linux on Docker (only 5 mb Alpine Linux)
- [Fix] Docker Error response from daemon: manifest for :latest not found: manifest unknown
- How to Stop/Cancel/kill docker image pull
- Install and Run Cassandra on Docker Desktop
- [fix] Cannot connect to the Docker daemon at unix:var/run/docker.sock. Is the docker daemon running?
- Connect to local macOS/Windows localhost (127.0.0.1) from within Docker Container Image
- Unable to find image docker latest locally
- Open Docker Desktop from macOS Terminal