Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

244
Visualizações
Docker containers in real life

I have been following the tutorials and been experimenting with Docker for a couple of days but I can't find any "real-world" usage example..

How can I communicate with my container from the outside?

All examples I can find ends up with 1 or more containers, they can share ports with their-others, but no-one outside the host gets access to their exposed ports.

Isn't the whole point of having containers like this, that at least 1 of them needs to be accessible from the outside?

I have found a tool called pipework (https://github.com/jpetazzo/pipework) which probably will help me with this. But is this the tool everyone testing out Docker for production what they are using?

Is a "hack" necessary to get the outside to talk to my container?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You can use the argument -p to expose a port of your container to the host machine.

For example:

  sudo docker run -p80:8080 ubuntu bash

Will bind the port 8080 of your container to the port 80 of the host machine.

Therefore, you can then access to your container from the outside using the URL of the host:

  http://you.domain -> losthost:80 -> container:8080

Is that what you wanted to do? Or maybe I missed something

(The parameter -expose only expose port to other containers (not the host))

over 4 years ago · Santiago Trujillo Relatório

0

This (https://blog.codecentric.de/en/2014/01/docker-networking-made-simple-3-ways-connect-lxc-containers/) blog post explains the problem and the solution.

Basicly, it looks like pipeworks (https://github.com/jpetazzo/pipework) is the way to expose container ports to the outside as of now... Hope this gets integrated soon..

Update: In this case, iptables was to blame, and there was a rule that blocked forwarded traffic. Adding -A FORWARD -i em1 -o docker0 -j ACCEPT solved it..

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda