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.

  • How to rename a docker image in the remote registry
  • run docker exec from swarm manager
  • Docker Compose - Command using Container Environment Variable
  • Docker(compose) installing nodejs broke npm
  • How to set busybox vi auto wrap when a line too long?
  • creating a file inside /etc/apt/sources.list.d/
  • 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

  • Running Boot2Docker on windows, can't connect to the VM ip
  • Docker maven and jenkins, mvn install failed requesting junit:junit:jar:3.x
  • I config docker bridge but now the network in container can't work will
  • what does VOLUME command do in Dockerfile?
  • error parsing HTTP 404 response body: invalid character '<' looking for beginning of value docker
  • Docker Volumes: Docker Volume does not get mounted correctly on Amazon Linux
  • 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.