Do Dockerfile WORKDIR, ENTRYPOINT, VOLUME … apply to child images?

I want to create two Docker images, one being the child of the other. But I don’t know if the properties (such as WORKDIR, ENTRYPOINT , VOLUME, …) I specified in the parent will apply to child.

For example if I have these two images with these two Dockerfiles :

  • Among Kubernetes, OpenShift, Docker Swarm and Docker DataCenter deployment tools which all are having automatic rollback?
  • What is driver name of docker for mac?
  • Dockerfile: mkdir and COPY commands run fine but I can't see the directory and file
  • How do i migrate mysql data directory in docker container?
  • Event Sourcing in Microservices Using Spring Cloud and Reactor
  • Hyperledger Fabric with docker not storing data after restart
    • myrepo/webapp-build

      FROM ruby:2.2.3
      RUN mkdir -p /app
      WORKDIR /app
      COPY Gemfile Gemfile.lock ./
      RUN gem install bundler && bundle install
      VOLUME /app
      ENTRYPOINT ["bundle", "exec"]
    • myrepo/webapp

      FROM myrepo/webapp-build
      COPY . ./
      EXPOSE 3000
      CMD ["rails", "server", "-b", ""]

    Will the second image copy the files into /app ? Will my entrypoint in the second image be bundle exec ?

  • Docker - No route to host
  • docker exec command with Popen in Python
  • How to check the configuration of an app deployed on docker container
  • Permission Denied while trying to connect to Docker Daemon while running Jenkins pipeline in Macbook
  • Python web application project structure and docker support
  • Docker compose and REST config
  • One Solution collect form web for “Do Dockerfile WORKDIR, ENTRYPOINT, VOLUME … apply to child images?”

    Those properties do propagate from one base image to another using said base image (with a FROM directive).

    But regarding WORKDIR, it is better to repeat it in order to document what ‘.’ means in a COPY . xxx

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