mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: Allow container matching by ID prefix (#175)
This commit is contained in:
@@ -28,7 +28,7 @@ func NewExecCommand() *cobra.Command {
|
||||
Use: "exec [OPTIONS] SERVICE [COMMAND ARGS...]",
|
||||
Short: "Execute a command in a running service container",
|
||||
Long: `Execute a command (interactive shell by default) in a running container within a service.
|
||||
If the service has multiple replicas, the command will be executed in a random container.
|
||||
If the service has multiple replicas and no container ID is specified, the command will be executed in a random container.
|
||||
`,
|
||||
Example: `
|
||||
# Start an interactive shell ("bash" or "sh" will be tried by default)
|
||||
@@ -37,8 +37,8 @@ If the service has multiple replicas, the command will be executed in a random c
|
||||
# Start an interactive shell with explicit command
|
||||
uc exec web-service /bin/zsh
|
||||
|
||||
# List files in the specific container of the service
|
||||
uc exec --container d792ea7347e5 web-service ls -la
|
||||
# List files in the specific container of the service; --container accepts full ID or a (unique) prefix
|
||||
uc exec --container d792e web-service ls -la
|
||||
|
||||
# Pipe input to a command inside the service container
|
||||
cat backup.sql | uc exec -T db-service psql -U postgres mydb
|
||||
|
||||
Reference in New Issue
Block a user