docker:tldr:e7c2e
docker: Export a container's filesystem as a tar archive.
$ docker container export ${container_name}
try on your machine
The command "docker container export" is used to export the contents of a Docker container to a tar archive. Here's a breakdown of the command:
- "docker container" is the command to interact with Docker containers.
- "export" is the subcommand that performs the export operation.
- "${container_name}" is a placeholder for the name or ID of the container you want to export.
When you execute this command, Docker will stop the specified container (if it's running), create a tar archive of its file system, including all files and directories, and save it to the local file system. The exported tar archive will contain the container's file system structure and the contents of all files and directories within it.
You can then use this exported tar archive to import the container into another Docker environment or extract specific files from it if needed.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.