HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/__pycache__/docker.cpython-312.pyc
�

�� ��N�dZddlmZddlmZddlmZddlZddlmZddlmZddlm	Z	dd	l
mZdd
lm
ZddlmZddlmZej"Zd
Zej(ej*j,�ej.de��Gd�dej0���Zy)z�Enable Docker CLI access to Google Container Registry.

Sets Docker up to authenticate with Container Registry,
and passes all flags after `--` to the Docker CLI.
�)�absolute_import)�division)�unicode_literalsN)�arg_parsers)�base)�
exceptions)�log)�
client_lib)�	constants)�dockera`gcloud docker` will not be supported for Docker client versions above 18.03.

As an alternative, use `gcloud auth configure-docker` to configure `docker` to
use `gcloud` as a credential helper, then use `docker` as you would for non-GCR
registries, e.g. `docker pull gcr.io/project-id/my-image`. Add
`--verbosity=error` to silence this warning: `gcloud docker
--verbosity=error -- pull gcr.io/project-id/my-image`.

See: https://cloud.google.com/container-registry/docs/support/deprecation-notices#gcloud-docker
F)�
is_removed�warningc�B�eZdZdZdej
iZed��Zd�Z	y)�Dockera�Enable Docker CLI access to Google Container Registry.

  {command} wraps Docker commands so that `gcloud` can
  inject the appropriate fresh authentication token into requests that interact
  with the Docker registry.

  All Docker-specific flags are passed through to the underlying `docker`
  command. A full reference of Docker's command line options available after
  `--` can be found here:
  [](https://docs.docker.com/engine/reference/commandline/cli/). You may also
  run `{command} -- --help` to view the Docker CLI's help directly.

  Detailed documentation on Container Registry can be found here:
  [](https://cloud.google.com/container-registry/docs/)

  ## EXAMPLES

  To pull the image '{registry}/google-containers/pause:1.0' from the docker
  registry, run:

  ```
  {command} -- pull {registry}/google-containers/pause:1.0
  ```

  Push the image '{registry}/example-org/example-image:latest' to our private
  docker registry.

  ```
  {command} -- push {registry}/example-org/example-image:latest
  ```

  Configure authentication, then simply use docker:

  ```
  {command} --authorize-only
  docker push {registry}/example-org/example-image:latest
  ```

  �registryc	��|jddtjd��dddt��|jd	d
dd�
�|jdd��|jdtj
gd��y)Nz--serverz-s�)�
min_length�SERVERz%Address of the Google Cloud Registry.F)�type�metavar�help�required�defaultz--authorize-onlyz-azKConfigure Docker authorization only; do not launch the Docker command-line.�
store_true)r�actionz
--docker-hostzSURL to connect to Docker Daemon. Format: tcp://host:port or unix:///path/to/socket.)r�docker_argszArguments to pass to Docker.)�nargsrr)�add_argumentr�ArgList�_DEFAULT_REGISTRIES�argparse�	REMAINDER)�parsers �lib/surface/docker.py�ArgszDocker.Argses���
����D�
�
 �
 �A�
.��
4��#�
�%�����D���	������"��#�
����X�/�/��
+��-�c��|jrtjd�tj�5d}|j
D]H}|tvr%tjdj|���tj||��d}�J|jrCtjjdj|j
���	ddd�y|jxsg}|js|nd	|jg|z}tj |�}|rt#j$|�
��	ddd�y#1swYyxYw)aExecutes the given docker command, after refreshing our credentials.

    Args:
      args: An argparse.Namespace that contains the values for
         the arguments specified in the .Args() method.

    Raises:
      exceptions.ExitCodeNoError: The docker command execution failed.
    z�Docker uses the account from the gcloud config.To set the account in the gcloud config, run `gcloud config set account <account_name>`.Tz1Authenticating to a non-default server: {server}.)�server)�refreshFz+Short-lived access for {server} configured.Nz-H)�	exit_code)�accountr	rr�WithLegacyQuotar)r!�formatr�UpdateDockerCredentials�authorize_only�err�Printr�docker_host�docker_client_utils�Executer�ExitCodeNoError)�self�args�
force_refreshr)r�results      r%�Runz
Docker.Run}s5���|�|�
�k�k�@�A�
�	�	�	��m��K�K�&��,�,�

�+�+�A�H�H��I�!�"�	�&�&�v�}�E��
� �
�	�	�
	���
�
�C�J�J��;�;�K� �	!��%
 �	�(�$�$�*��k�!�-�-�+�D�$�:J�:J�3K�
�4��#�*�*�;�7�f�
��(�(�6�:�:��=
 �	�	�s�B E�AE�EN)
�__name__�
__module__�__qualname__�__doc__r�DEFAULT_REGISTRY�
detailed_help�staticmethodr&r;�r'r%rr6s5��&�R�)�,�,��-��-��-�.2
r'r)r?�
__future__rrrr"�googlecloudsdk.callioperrr�googlecloudsdk.corer	�googlecloudsdk.core.dockerr
r4rr�"DEFAULT_REGISTRIES_TO_AUTHENTICATEr!�_DEPRECATION_WARNING�
ReleaseTracks�ReleaseTrack�GA�	Deprecate�CommandrrCr'r%�<module>rOs��� �'��'��/�(�.�#�H�0�-� �B�B��
������D�%�%�(�(�)�����5�*>�?�w
�T�\�\�w
�@�*�w
r'