I am having a lot of issues trying to find the answer to the problems I am having with setting up a container, and then accessing files I want to use for testing of that container. I started off with trying the docker cp command, but when the file was copied it was copied as root so I was unable to access it under the separate user I created. I then tried to perform the task in the Dockerfile with COPY and ADD but that also was given me permission issues. I’ve tried numerous things on the internet such as chown, but I cannot figure this out.
RUN useradd -s /bin/bash -m test
COPY . /home/test/
RUN chown -R test /home/test/test_directory