How to COPY files of current directory to folder in Dockerfile

I’m trying to create a Dockerfile that copies all the files in the currently directory to a specific folder.

Currently I have

  • uwsgi layer blocks one particular API call from nginx
  • Is it possible to allow docker use the host machines dnses?
  • Docker for Windows 10 //./pipe/docker_engine: access is denied
  • getting python and react component based container to work
  • Cannot seem to install Google Cloud Managed VMs
  • Dockerfile: is it necessary to specify which user before perform a RUN?
  • COPY . /this/folder
    

    I’m unable to check the results of this command, as my container closes nearly immediately after I run it. Is there a better way to test if the command is working?

  • Docker nginx SELinux (centOS/RHEL) with 403 forbidden access
  • Building Docker Images with Drone.io
  • Not able to run Meteor application in Docker container because of couldn't run ps ax error
  • Transitioning from other local development tools to Docker
  • Why are docker host volumes being mounted incorrectly?
  • Do Docker containers share a single Python GIL?
  • 2 Solutions collect form web for “How to COPY files of current directory to folder in Dockerfile”

    you can start a container and check.

    $ docker run -ti --rm <DOCKER_IMAGE> sh
    $ ls -l /this/folder
    

    If your docker image has ENTRYPOINT setting, then run below command:

    $ docker run -ti --rm --entrypoint sh <DOCKER_IMAGE>
    $ ls -l /this/folder
    

    If it is only for testing, include the below command in your docker file:

    RUN cd /this/folder && ls
    

    This will list the directory contents while docker build

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