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 :

  • How to enable_ipv6 with docker compose version 3
  • Remote access services exposed by docker container
  • Sails application cannot accessed from web browser. Connection refused
  • Artifactory as docker Registry - docker-remote-cache stays empty
  • Docker + rails 4 :, weird error during : RUN bundle exec rake assets:precompile
  • kubernetes cannot pull local image
    • 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 ?

  • Can't run docker on os X with boot2docker
  • SpringBoot with Tomcat uses around 190mb of memory. What processes are running within Springboot?
  • Using same containers with multiple project on local host
  • The ENV --insecure-registry can't work as expected in docker
  • Why is nginx returning a 502 when doing a `uwsgi_pass` to a linked docker container?
  • Dockerizing PostgreSQL - psql Connection refused
  • 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.