Docker Community Forums

Share and learn in the Docker community.

How to create a directory in a docker container that is created but not yet running?

I create a container using the docker container create command. Now I want to copy some files to this container in a directory that does not exist. If I try:

$ docker cp file.txt nginx:/etc/ssl/file.txt

where /etc/ssl doesn’t exist, I get this error:

Error: No such container:path: nginx:/etc/ssl

So how I can create the directory?