How to copy files to each user's space in docker

I am writing a docker file to conduct an evaluation of an R package that I have written. The package is installed inside RStudio server. My docker file inherits from FROM rocker/rstudio. I want the docker file to install the everything (which it does) and create 20 users (user1, user2, …, user20) as test subjects. Each test subject additionally should have a data folder (/home/data) to contain some CSV files.
Later when the container is run, The RStudio’s web interface allows the test subjects to login using the user credentials just created. They have access to their own data, perform the tests, and generates some new files in their home directory.

I am able to create the users using RUN useradd -ms /bin/bash user1 and set the current user to users USER user1, but do not know how to transfer the files alongside the Dockerfile.

  • Docker as the effective Rails development environment
  • How to check if the restart policy works of Docker
  • Assigning docker container to a recieved from outside port with Python
  • Docker Ruby Rack Redis Queues
  • Deis not creating a build when pushing application
  • Docker with Angular 4 and Django is compiled successfully but localhost:4200 is not working
  • Note 1: I do not like the dea of putting the files on the host machine and sharing them with the docker users. Instead I want to have them shipped with the Dockerfile and get them added to the image and container when the Dockerfile is built and run.
    Note 2: I need to do the evaluation is a reproducible way, because I need to repeat it several times.

  • How can I speed up Rails Docker deployments on Google Cloud Platform?
  • Run multiple docker-compose (one per machine)
  • boot2docker access elasticsearch on localhost
  • Connection refused when trying to run Kong API Gateway using a docker container
  • Docker image for windows with oracle12
  • java.net.UnknownHostException on Docker
  • One Solution collect form web for “How to copy files to each user's space in docker”

    You can use the COPY or ADD command in the dockerfile to get files in to you docker machine. Have a look here for more information.

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