![]() The -p option tells docker to bind port 80 on the host (your laptop) to port 80 in the container (which we exposed in the image). Then, when launching the container based on this image be sure to specify the port binding you would like to use: docker run -n -p 80:80 -d YOUR_IMAGE The EXPOSE command exposes port 80 to the external of the container (If you need to expose a different port just use that instead of 80). If you are using a pre-built image this is usually taken care of for you, but if you are building an image yourself from a Dockerfile you need to add the following line near the end: EXPOSE 80 Export the port in your containerįirst, you should make sure to expose the port in the image you are running. Have no fear, here is your guide to getting port forwarding working for Docker on OSX: If you’ve tried to run Docker 0.8 on OSX, you know that everything works great except for port forwarding.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |