Can’t access to container from local network.
macOS Ventura Version 13.1 (22C65)
Docker Desktop 4.15.0 (93002)
Running MySQL server. Trying access to server from devices in local network. Spend one week on slowing problem , but still no results. Can anyone guide me please ?
And how exaxtly are you trying to access the container? The IP addresses of the containers will not be accessible from the host. You need to forward host ports to the containers.
Docker Desktop runs containers in a virtual machine. Doesn’t matter how you change the IP address of the containers, you will not be able to access it from the host or other devices. You need port forwarding.
docker run -d -p 8888:80 --name httpd httpd:2.4
It would run HTTPD and make it available on port 8888 from the host and if your firewall allows it, you can access it from other devices. The port number on the right side is the port on which the service inside the container is listening.
Got it .
When trying do same with MySQL docker run --name -p 8888:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
receiving error : docker: Error response from daemon: pull access denied for 8888, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
It’s trying pull it from hub-repo ?
it’s work! On other devices i connect to mac’s IP with selected ports . @rimelek Thanks a lot for help ! Hope this post help confused beginners like me