I am currently trying to build an image using a Dockerfile. At the end of the Dockerfile I have implemented echo for testing purposes.
FROM nginx:1.21.6-alpine
RUN echo 'hello world'
It seems that nothing is printed on the console. Also, I don’t get a message that the image was built successfully.
docker build .
[+] Building 2.9s (6/6) FINISHED
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 90B
=> [internal] load .dockerignore
=> => transferring context: 57B
=> [internal] load metadata for docker.io/library/nginx:1.21.6-alpine
=> [1/2] FROM docker.io/library/nginx:1.21.6-alpine@sha256:a74534e76ee1121d418fa7394ca930eb67440deda413848bc67c68138535b989
[...]
=> [2/2] RUN echo 'hello world'
=> exporting to image
=> => exporting layers
=> => writing image sha256:efbbc04c40c43edb7e31a24df67807fcb469f1ec46ba0d964b12e040ee39e656
Shouldn’t a “hello world” be displayed in the console? When I try to start the image, I also get an error message:
Error invoking remote method ‘docker-run-container’: Error: (HTTP code 400) unexpected - invalid reference format
The image also has no name and no tag:
Is that correct? What am I doing wrong?