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

348
Views
I get an error when running the Dockerfile

So I've built an image with docker build -t myimage2:1.0 .

This is my Dockerfile:

#getting base image
FROM ubuntu

MAINTAINER gilebrt <email@bla.com>

RUN apt-get update

CMD ["echo", "Hello World"]

But when running docker run myimage2:1.0, I get the error below

/bin/sh: 1: [“echo”,”Hello: not found

I tried changing the CMD line, among other things to: CMD "echo hello World", but I still get the error:

/bin/sh: 1: echo hello World: not found

I am using Ubuntu 16.04.6 LTS
I am sure it's something silly, but I can't find the issue... Thanks in advance!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You should wrap "Hello World" with quotes, otherwise it will execute as echo Hello World, which is not valid, it should be echo "Hello World".

#getting base image
FROM ubuntu

MAINTAINER gilebrt <email@bla.com>

RUN apt-get update

CMD ["echo", "\"Hello World\""]
over 4 years ago · Santiago Trujillo Report

0

CMD ["echo", "Hello World"] would do.

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!