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

  • sensitive information required for docker build
  • Can't run Ecplise Che under ubuntu
  • Docker Rails app fails to be served - curl: (56) Recv failure: Connection reset by peer
  • Seeding a MySQL DB for a Dockerized Django App
  • Where can I get the newest “Setting Up a Dev Environment” for Docker?
  • Sending mail using GNU Mailutils inside Docker container
  • 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?

  • How do I enter this dockerfile / nginx container?
  • Docker worklfow of testing images
  • Use spacy docker API
  • How do I make a comment in a Dockerfile?
  • passing docker flag --net=host to selenium/standalone-chrome-debug, image fails
  • Vagrant docker shellinit?
  • 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.