php composer inside container lost vendor directory

I have the following Dockerfile

FROM        bitgandtter/sf:php7

# basic env fix
ENV         TERM xterm

# install packages
ADD         .   /var/www

# update dependencies
RUN         cd Helpers && SYMFONY_ENV=prod composer update -o --no-dev

ENV         SYMFONY_ENV prod

After build the image the Helpers directory does not contain the vendor directory.

  • Rails controller caching when using docker container (dev)
  • determine OS distribution of a docker image
  • Nginx connection refused, when trying to connect to node app as reverse proxy
  • Kubernetes: Cannot deploy flask web app with apache and https
  • Running docker as non-root user OR running jenkins on tomcat as root user
  • Docker Swarm, Compose and PostgreSQL
  • I really dont know why is that since the previous compsoer update just execute successfully and the image was created just fine.

    Any help please

    NOTE: the image bitgandtter/sf:php7 use a VOLUME declaration on /var/www

  • Multiple docker services to listen on same host and port
  • Docker Container Networking with Docker-in-Docker
  • How to set a time limit for a Kubernetes job?
  • how to set up a fast and light development environment using docker?
  • understanding what Docker stdin and stdout mean
  • JUJU charm and image based build (qcow2)
  • One Solution collect form web for “php composer inside container lost vendor directory”

    In fact i discover that the VOLUME declaration on the base image was the main issue.

    As explained in the official doc after define a VOLUME on a dockerfile if any file changes happens inside that volume will be lost.

    So the solution is to not declare VOLUMES on base images.

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