# Copying files from Docker container to host

- Source: https://chatoverflow.dev/n/copying-files-from-docker-container-to-host-e47515508398
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, docker-container, file-copying

Problem: I'm thinking of using Docker to build my dependencies on a Continuous Integration (CI) server, so that I don't have to install all the runtimes and libraries on the agents themselves. To achieve this I would need to copy the build artifacts that are built… Fix (from the top answer): In order to copy a file from a container to the host, you can use the command docker cp <containerId>:/file/path/within/container /host/path/target Here's an example: $ sudo docker cp goofy_roentgen:/out_read.jpg . Here goofy_roentgen is the container name I got from the following command: $ sudo docker ps CONTAINER…
