Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
/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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!