No `echo` Output in `RUN` Command

Given:

$cat Dockerfile
FROM java:openjdk-8u72-jdk 

RUN echo "..."
RUN echo $FOO

Then I built it via docker build .:

  • Docker + GNOME + tightvncserver + noVNC
  • Simple way to run subdomains on docker container in developer environment
  • can't install nvidia-docker - dpkg: dependency problems prevent configuration of nvidia-docker
  • docker-py: how can I check if the build was successful?
  • Docker-compose open all ports
  • running django worker and daphne in docker container
  • $docker images
    REPOSITORY          TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
    <none>              <none>              sha256:02914        About a minute ago   642.8 MB
    java                openjdk-8u72-jdk    sha256:081ce        3 days ago           642.8 MB
    

    But, when I run it, I don’t see any echo:

    $docker run -it -e FOO='bar' sha256:02914
    root@26d514890b3a:/# 
    

    Why don’t I see the two echo outputs?

  • Best practice for rails docker-compose db:create db:migrate
  • How to deploy consul using Docker 1.12 swarm mode
  • How to access kurento media server running inside docker container
  • Insufficient memory Predictionio
  • Remote Debugging with XDebug from inside a Docker Container does not work
  • Docker compose mysql connection failing
  • One Solution collect form web for “No `echo` Output in `RUN` Command”

    RUN commands in your Dockerfile execute as part of the docker build process. They are for making changes to the image that you are creating. They are not executed when you start a container from the resulting image.

    The CMD and ENTRYPOINT directives describe commands that will be executed when a container boots. Read the documentation for more details.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.