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 (https://github.com/stilliard/docker-pure-ftpd).

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:

  • How to debug kuberenetes system pod elections on masters?
  • DistributionNotFound when running pserve with docker-compose
  • persist and share data from docker mongo container (with docker)
  • Docker-plugin on Jenkins fails to Test Connection
  • Build Docker image only if Code Repository has been updated (Jenkins)
  • Files created in docker build not present in container created from image
  • 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?

  • Starting Docker-Engine on boot
  • Dockerfile COPY wildcard to only match files, not folders
  • Serve dockerized ZendFramework2 Application with nginx
  • Docker force container to specific physical interface
  • docker-compose build error ubuntu mango
  • Is this possible to get all running containers id's in docker swarm services?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.