How to copy files to/from a Sitecore container


Description

Some tasks might require copying files from a local machine into a container or from a container to the local machine. This article describes how to perform these operations.

Solution

Consider the option defined below depending on your needs:

Because files can be copied to/from the "C:\inetpub\wwwroot" folder, it might be necessary to move/copy files inside the container. It could be done using PowerShell session: KB013773.

To read more about cp commands, refer to the following links:

Notes

  1. You can copy files between running containers and host file system when containers run with process isolation.
    Note that these operations are not supported for the Hyper V isolation mode. If Hyper V isolation is used the container must be stopped before copying the file.
  2. The files copied to containers using these approaches are removed once the container has been recreated. To store the copied files in containers on a permanent basis, build a custom Docker image according to the Docker official documentation.