gcloud_compute_instances_update-container (1)
NAME
- gcloud compute instances update-container - updates Google Compute engine virtual machine instances running container images
SYNOPSIS
-
gcloud compute instances update-container INSTANCE_NAME [--container-image=CONTAINER_IMAGE] [--container-privileged] [--container-restart-policy=POLICY] [--container-stdin] [--container-tty] [--zone=ZONE] [--clear-container-args | --container-arg=CONTAINER_ARG] [--clear-container-command | --container-command=CONTAINER_COMMAND] [--container-env=[KEY=VALUE, ...,...] --container-env-file=CONTAINER_ENV_FILE --remove-container-env=[KEY,...]] [--container-mount-host-path=[host-path=HOSTPATH,mount-path=MOUNTPATH[,mode=MODE],...] --container-mount-tmpfs=[mount-path=MOUNTPATH,...] --remove-container-mounts=[MOUNTPATH[,MOUNTPATH,...],...]] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
gcloud compute instances update-container updates Google Compute Engine
-
$ gcloud compute instances update-container instance-1 \
--zone us-central1-a \
--container-image=gcr.io/google-containers/busybox
updates an instance called instance-1, in the us-central1-a zone, to run the 'busybox' image.
For more examples, refer to the EXAMPLES section below.
POSITIONAL ARGUMENTS
-
- INSTANCE_NAME
-
Name of the instance to update.
FLAGS
-
- --container-image=CONTAINER_IMAGE
-
Sets container image in the declaration to the specified value.
Empty string is not allowed.
- --container-privileged
-
Sets permission to run container to the specified value.
- --container-restart-policy=POLICY
-
Sets container restart policy to the specified value. POLICY must be one
of: never, on-failure, always.
- --container-stdin
-
Sets configuration whether to keep container STDIN always open to the
specified value.
- --container-tty
-
Sets configuration whether to allocate a pseudo-TTY for the container to the
specified value.
- --zone=ZONE
-
Zone of the instance to update. If not specified, you may be prompted to select
a zone. gcloud will attempt to identify the zone by searching for
resources in your project. If the zone cannot be determined, you will then be
prompted with all Google Cloud Platform zones.
To avoid prompting when this flag is omitted, you can set the compute/zone property:
- $ gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
- $ gcloud compute zones list
To unset the property, run:
- $ gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.
-
At most one of these may be specified:
-
- --clear-container-args
-
Removes the list of arguments from container declaration.
Cannot be used in the same command with --container-arg.
- --container-arg=CONTAINER_ARG
-
Completely replaces the list of arguments with the new list. Each argument must
have a separate --container-arg flag. Arguments are appended the new list in
the order of flags.
Cannot be used in the same command with --clear-container-arg.
-
-
At most one of these may be specified:
-
- --clear-container-command
-
Removes command from container declaration.
Cannot be used in the same command with --container-command.
- --container-command=CONTAINER_COMMAND
-
Sets command in the declaration to the specified value. Empty string is not
allowed.
Cannot be used in the same command with --clear-container-command.
-
- --container-env=[KEY=VALUE, ...,...]
-
Update environment variables KEY with value VALUE passed to
container.
-
- ---
- Sets KEY to the specified value.
- ---
- Adds KEY = VALUE, if KEY is not yet declared.
- ---
- Only the last value of KEY is taken when KEY is repeated more
-
than once.
Values, declared with --container-env flag override those with the same
KEY from file, provided in --container-env-file.
-
- --container-env-file=CONTAINER_ENV_FILE
-
Update environment variables from a file. Same update rules as for
--container-env apply. Values, declared with --container-env
flag override those with the same KEY from file.
File with environment variables declarations in format used by docker (almost). This means:-
- ---
- Lines are in format KEY=VALUE
- ---
- Values must contain equality signs.
- ---
- Variables without values are not supported (this is different from
-
docker format).
-
- *
- If # is first non-whitespace character in a line the line is ignored
as a comment.
-
- --remove-container-env=[KEY,...]
-
Removes environment variables KEY from container declaration Does nothing,
if a variable is not present.
- --container-mount-host-path=[host-path=HOSTPATH,mount-path=MOUNTPATH[,mode=MODE],...]
-
Mounts a volume by using host-path.
-
- ---
- Adds a volume, if mount-path is not yet declared.
- ---
- Replaces a volume, if mount-path is declared.
-
All parameters (host-path, mount-path, mode) are completely
replaced.
-
- host-path
-
Path on host to mount from.
-
- mount-path
-
Path on container to mount to. Mount paths with spaces and commas (and other
special characters) are not supported by this command.
- mode
-
Volume mount mode: rw (read/write) or ro (read-only).
Default: rw.
-
- --container-mount-tmpfs=[mount-path=MOUNTPATH,...]
-
Mounts empty tmpfs into container at MOUNTPATH.
-
- mount-path
-
Path on container to mount to. Mount paths with spaces and commas (and other
special characters) are not supported by this command.
-
- --remove-container-mounts=[MOUNTPATH[,MOUNTPATH,...],...]
-
Removes volume mounts (host-path, tmpfs) with mountPath: MOUNTPATH from container declaration.
Does nothing, if a volume mount is not declared.
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
To run the gcr.io/google-containers/busybox image on an instance named 'instance-1' that executes 'echo "Hello world"' as a run command, run:
-
$ gcloud compute instances update-container instance-1 \
--container-image=gcr.io/google-containers/busybox \
--container-command='echo "Hello world"'
To run the gcr.io/google-containers/busybox image in privileged mode, run:
-
$ gcloud compute instances update-container instance-1 \
--container-image=gcr.io/google-containers/busybox \
--container-privileged
NOTES
These variants are also available:
- $ gcloud alpha compute instances update-container $ gcloud beta compute instances update-container