---
title: "Copying files from host to Docker container"
author: "scm002"
date: "2017-06-26T14:53:46Z"
tags: []
categories: ["开源软件"]
slug: "copying-files-from-host-to-docker-container"
draft: false
lastmod: "2017-06-26T14:53:46Z"
id: 2381459
url: "https://scm002.iteye.com/blog/2381459"
---

The `cp` command can be used for that. For example:

```
docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt
```

 

https://docs.docker.com/engine/reference/commandline/cp/

http://blog.csdn.net/yangzhenping/article/details/43667785