CF-Incidents Containers - SSH into running Container instances

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
You can now SSH into running Container instances using Wrangler. This is useful for debugging, inspecting running processes, or executing one-off commands inside a Container.

To connect, enable wrangler_ssh in your Container configuration and add your ssh-ed25519 public key to authorized_keys:


Code:
{
	"containers": [
		{
			"wrangler_ssh": {
				"enabled": true
			},
			"authorized_keys": [
				{
					"name": "<NAME>",
					"public_key": "<YOUR_PUBLIC_KEY_HERE>"
				}
			]
		}
	]
}

Code:
[[containers]]
[containers.wrangler_ssh]
enabled = true

[[containers.authorized_keys]]
name = "<NAME>"
public_key = "<YOUR_PUBLIC_KEY_HERE>"

Then connect with:


wrangler containers ssh <INSTANCE_ID>

You can also run a single command without opening an interactive shell:


wrangler containers ssh <INSTANCE_ID> -- ls -al

Use wrangler containers instances <APPLICATION> to find the instance ID for a running Container.

For more information, refer to the SSH documentation.

Continue reading...
 
Back
Top