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

491
Visualizações
Passing argument to python application running on docker

I want to pass argument to python file app.py while running its docker image using command :

docker run -d -p 5000:5000 python_app https://github.com/abc/repo

where python_app is image of my application and https://github.com/abc/repo is the argument which I want to pass. But when I run docker image using above command my container exits with error :No such directory or file found

This is my Dockerfile

FROM python:2.7.13
MAINTAINER xyz "abc@hotmail.com"
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["app.py","https://github.com/abc/repo"]

I think my param2 in CMD is treated an argument for docker image rather than argument for python application.

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

0

td;lr use ENTRYPOINT ["python", "app.py"] then you can pass parameters to the docker run

see answer here: how to pass command line arguments to a python script running in docker td

about 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