cpln cp command copies files and directories between your local machine and workload containers, similar to kubectl cp or docker cp.
When to use this
Upload configuration files
Copy config files, scripts, or data to a running container
Download logs or data
Retrieve log files, generated data, or debug artifacts from containers
Debug running workloads
Transfer debugging tools or inspect container state
Migrate data
Move files between local development and deployed workloads
Prerequisites
CLI installed
CLI installed
Install the Control Plane CLI before proceeding. See Installation.
Running workload
Running workload
You need a running workload in at least one location. See the Create a Workload guide.
Container has tar
Container has tar
The
tar binary must be installed in the container image.Required permissions
Required permissions
You need
exec permission on the workload. See Workload Permissions.Basic usage
Options
| Option | Description |
|---|---|
--location | Target location (defaults to first available in GVC) |
--replica | Target replica (defaults to first replica) |
--container | Target container (defaults to first container) |
--no-preserve | Don’t preserve ownership and permissions |
Copy to a workload
- File
- Directory
- Rename on copy
Copy a local file to a container:The file is placed in
/app/config/config.json in the container.Copy from a workload
- File
- Directory
- Rename on copy
Download a file from a container:
Target specific replicas
When a workload has multiple replicas across locations, specify the exact target:Multi-container workloads
For workloads with multiple containers, specify the target container:If
--container is not specified, the command targets the first container defined in the workload spec.Common workflows
Upload a configuration file
Download application logs
Transfer debug tools
Troubleshooting
tar: not found
tar: not found
The container image doesn’t include
tar. Either:- Use an image with
tarinstalled - Install it in your Dockerfile:
RUN apt-get install -y tar - For Alpine:
RUN apk add --no-cache tar
Permission denied
Permission denied
The destination path may require elevated permissions. Try copying to
/tmp/ first, then move with exec:No replicas found
No replicas found
The workload may not be running in the specified location: