Writing to docker volume from Dockerfile does not work
16:58 22 Sep 2014

Please consider the following Dockerfile:

FROM phusion/baseimage
VOLUME ["/data"]
RUN touch /data/HELLO
RUN ls -ls /data

Problem: "/data" directory does not contain "HELLO" file. Moreover, any other attempts to write to volume directory (via echo, mv, cp, ...) are unsuccessful - the directory is always empty. No error messages shown.

I could not find anything in documentation or on stackoverflow regarding this problem.

Is this something well-known or new?

docker version returns:

Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.14
Go version (server): go1.3.1
Git commit (server): fa7b24f
docker docker-volume