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

696
Visualizações
Docker port mapping on AWS Elastic Beanstalk

I have a Docker container specified through Dockerfile which has to be run with the -p flag in order to function properly. On my local machine, after running

docker run -d -p 5000:5000 blagtagger:v0.4.3

the port mapping is shown as 0.0.0.0:5000->5000/tcp and everything works smoothly.

Now, I need to deploy it on AWS Elastic Beanstalk, so I prepared my Dockerrun.aws.json file as follows:

{
  "AWSEBDockerrunVersion": "1",
  "Ports": [
    {
      "ContainerPort": 5000,
      "HostPort": 5000
    }
  ]
}

However, the container port does not seem to map to the host port correctly. The port mapping is shown as 5000/tcp.

How can I ask Beanstalk to set the mapping to 0.0.0.0:5000->5000/tcp?

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

0

It turns out there is no elegant way to accomplish this. Along the lines of the answers here and here, I added the following in a file named .ebextensions/01-commands.config:

commands:
    00001_add_port_mapping:
        cwd: /tmp
        command: 'sed -i "s/docker run -d/docker run -p 5000:5000 -d/" /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh'

and discarded the Dockerrun.aws.json file.

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