Skip to content

Docker Passthrough

Graft provides a powerful “passthrough” capability that allows you to execute native docker commands directly on your remote servers. This eliminates the need to manually SSH into a server to perform maintenance, debugging, or advanced operations.

When you use the passthrough feature, Graft wraps your command and executes it as sudo docker <your-command> on the target host.

You can use passthrough commands in several ways depending on your context:

Target any server in your global registry, regardless of your current directory.

Terminal window
graft -r <registry-name> <docker-command>

Target the server where your current project (in the current directory) is deployed.

Terminal window
graft host <docker-command>

Target a specific project’s host from anywhere, using the project flag.

Terminal window
graft -p <project-name> host <docker-command>

Target a specific environment’s host for a project.

Terminal window
graft -p <project-name> env <env-name> host <docker-command>

Authenticate with a private container registry on your remote server. This is useful if your deployment requires pulling images from a private repository.

Terminal window
# Log in to Docker Hub or a private registry on the remote host
graft -r vps login --username myuser --password-stdin < my_password.txt
# Or simply
graft -r vps login

Perform standard Docker operations for debugging.

Terminal window
# View running containers
graft host ps
# Follow logs for a specific container
graft host logs -f <container-id>
# Prune unused data
graft host system prune