I do have an already build docker image and wan't to add files to it AFTER the build was done. Is there a way to add files without rebuilding it (or maybe to add it and save it with an new tag)? I did find docker cp
but if I understand that right it does only work in running containers.
You can use the docker cp command to copy the file. The first path (Source) is the path in the Docker Container and the second one is the path inside your Local System (Destination).
Obtain the name or id of the Docker container. Issue the docker cp command and reference the container name or id. The first parameter of the docker copy command is the path to the file inside the container. The second parameter of the docker copy command is the location to save the file on the host.
Docker cp Command It can only be used to copy files between the host system and a single container.
docker cp
but if I understand that right it does only work in running containers
Still, that might work considering you can then commit a container into a new image.
See docker commit
.
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With