Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.1K
Vistas
/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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda