

Enter the container folder that needs to be modified according to the container id If the interactive window cannot enter the interactive window or the window is garbled, you can operate it after restarting the docker service.ģ. ➜ 64-linux screen ttyĪfter executing the screen tty command, you may see a blank window, and then press Enter, you will see the interaction. ~/Library/Containers//Data/64-linux/ ➜ ~ cd ~/Library/Containers//Data/64-linux/

Go to the docker directory and use the screen command to enter the virtual machine window.īecause, I use Docker for Mac Application, it appears that the containers are stored within the VM located at: The port mapping to the existing container can also be realized by modifying the configuration file.įor example, we map a new port to the container named: ubuntu-lnmpġ. Similarly, you can open a browser on the mac host to access the container service. Create a new container from the image Ubuntu LNMP and map the port ➜ ~ docker run -i -t -h lnmp -name ubuntu-lnmp -p 9092:80 081b2232c327 /bin/bashĦ. Create a new image from a container’s changes ➜ ~ docker commit e50b532a5017 ubuntu-lnmp Stop container ➜ ~ docker stop e50b532a5017ģ. Now let’s perform port mapping on existing containers and mac hosts.Ģ. The container named u-lnmp did not perform port mapping with the mac host when it was created.
#Docker for mac config.json how to
So How to do port mapping for existing containers? OK, here we have done the port mapping for the Mac host and the new container. Finally, open the safer browser on the MAC host and enter:
#Docker for mac config.json install
Install nginx on the docker container and start service. ➜ ~ docker run -i -t -h nginx -name webserver -p 9091:80 ccc6e87d482b /bin/bashģ.

Run a new docker container and map the port.
