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

349
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

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

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