Docker FTP Server Container Create Accessible Sub-directories

I am trying to create a Docker image to act as an FTP server. I am using the stilliard/pure-ftpd:hardened image (

I want to allow access to a user called ‘elections’ and to create two directories which will be accessible to that user, called ‘nominations’ and ‘results’. I extended the base image as follows:

  • Where is the default directory of the export csv file that COPY generated in cassandra?
  • Redis inter-container communication fails after restart of swarm manager
  • docker login behind proxy on private registry gives TLS handshake timeout
  • How to run docker builds from Jenkins on a Mac?
  • How do I compile python for Alpine?
  • Linking containers in Docker
  • FROM    stilliard/pure-ftpd:hardened
    RUN     (echo elections; echo elections) | pure-pw useradd elections -u ftpuser -d /home/ftpusers/elections
    RUN     pure-pw mkdb
    RUN     chown -hR ftpuser:ftpgroup /home/ftpusers
    RUN     mkdir -r /home/ftpusers/elections/nominations /home/ftpusers/elections/results

    (I know that echoing the password is bad, but it’s only on my dev machine for now!). I assumed that the two directories ‘nominations’ and ‘results’ would now be created and accessible to the user. But, when I run the Docker container these directories are not present.

    If I connect to the running container using elections@container-ip then I am able to create directories, but I want them to be present when I build the image.

    Can anyone explain what it is that I am misunderstanding here?

  • Docker: Mongo exits on run
  • Contents in the container's bind-mounted dir keep unchanged after mounting/umounting removable drive from the host
  • Using rexray volume driver for AWS
  • Windows Containers - culture settings
  • should I choose docker for isolated development of python? [closed]
  • How to enable AUFS on Debian?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.