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!
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\""]
CMD ["echo", "Hello World"] would do.