Docker Community Forums

Share and learn in the Docker community.

Docker cp: unable to copy a file to the tmpfs inside the container

docker

(Iexpl) #1

Note: container: /tmp/inside_tmp is a tmpfs
root@071e98dc1789:/tmp/inside_tmp# df
Filesystem 1K-blocks Used Available Use% Mounted on
overlay 482119132 27584676 434589856 6% /
tmpfs 65964316 0 65964316 0% /dev
tmpfs 65964316 0 65964316 0% /sys/fs/cgroup
/dev/sda9 482119132 27584676 434589856 6% /etc/hosts
shm 65536 0 65536 0% /dev/shm
tmpfs 65536 0 65536 0% /tmp/inside_tmp

node-001e67f85a08 docker # docker --version
Docker version 1.11.2, build bac3bae
node-001e67f85a08 docker # docker cp /tmp/jtest_tmp/test test_container:/THIS <-- WORKS, can see the file inside the container: /THIS
node-001e67f85a08 docker # docker cp /tmp/jtest_tmp/test test_container:/tmp/inside_tmp/THIS <— This does NOT work. No file at /tmp/inside_tmp/THIS inisde the container. Any idea why?
node-001e67f85a08 docker # echo $?
0
node-001e67f85a08 docker #


(Abhijithda) #2

I’m running into the same issue as well. Not able to docker cp any file present under /tmp inside container onto the host directory. Is this expected behavior?