Code Monkey home page Code Monkey logo

Comments (9)

FooBarWidget avatar FooBarWidget commented on May 31, 2024

It's because the web server listens on port 80 and 443 by default. Change it if you use different port numbers.

from baseimage-docker.

thomasleveil avatar thomasleveil commented on May 31, 2024

Is there any webserver in the baseimage ?
Aren't those ports only required to be exposed on the passenger-docker image ?

from baseimage-docker.

FooBarWidget avatar FooBarWidget commented on May 31, 2024

Oh, oops, I see what you mean now.

from baseimage-docker.

FooBarWidget avatar FooBarWidget commented on May 31, 2024

Actually, now that I've re-read the documentation, I think in baseimage-docker even port 22 should not be exposed. EXPOSE used to be used for exposing ports for port forwarding, but somewhere in 0.6 or 0.7 they changed it, and now EXPOSE is for exposing ports for use in linking. I will remove all EXPOSE entries.

from baseimage-docker.

thomasleveil avatar thomasleveil commented on May 31, 2024

I did not know that. Thank you for sharing 👍

from baseimage-docker.

misho-kr avatar misho-kr commented on May 31, 2024

Whats is the point of starting sshd in the container if the port to access it (22) is not exposed?

from baseimage-docker.

FooBarWidget avatar FooBarWidget commented on May 31, 2024

So that you can perform administration tasks.

Note that exposing the port is not required to be able to access the port. Exposing the port merely means that when you link the container to another container, that the port information is passed to that container. Whether a port is exposed or not, you can still access it through the container's private IP.

from baseimage-docker.

misho-kr avatar misho-kr commented on May 31, 2024

Indeed, it is accessible. Good to know, thanks.

It is not straight-forward to access a service when the port is not exposed, and it can be accessed only through the IP address of the container. So such access feels like a back door.

I am not saying it is wrong. It works, and if it is well documented then it is OK.

from baseimage-docker.

FooBarWidget avatar FooBarWidget commented on May 31, 2024

You are thinking about port forwarding. That is unrelated to exposing ports in the Dockerfile. As I mentioned before, exposing is only for use in linking containers. If you want to forward a port to the host then invoke 'docker run' with the right '-p' arguments.

from baseimage-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.