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

1.1K
Visualizações
/bin/sh: 1: sudo: not found when running dockerfile

This is the content of my Dockerfile.

FROM ubuntu

RUN sudo apt-get update

RUN sudo apt-get install -y wget

CMD wget -O- -q http://ifconfig.me/ip

When I run the Dockerfile to build a docker image, I get the below error:

/bin/sh: 1: sudo: not found

Can you please help me in solving the above error?

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

0

by default docker container runs as root user
remove the sudo from Dockerfile and run again.

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

Your commands in the Dockerfile already run as root during docker build. For this reason you do not need to use sudo

over 4 years ago · Santiago Trujillo Relatório

0

You don't need sudo in this case. Change Dockerfile as below -

FROM ubuntu

RUN apt-get update -y && \ 
    apt-get install -y wget

CMD wget -O- -q http://ifconfig.me/ip

PS - Merge the RUN statements as much as possible.

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