nitinsridar
nitinsridar

Reputation: 684

ERROR: gcloud crashed (TypeError): a bytes-like object is required, not 'str'

I'm getting the above error after running the below docker command:

gcloud docker --verbosity=error -- push gcr.io/devtest/pipeline:2.0.1

Please help me!

This the Docker version 19.03.8, build afacb8b Windows 10

Upvotes: 4

Views: 4787

Answers (5)

user16285092
user16285092

Reputation: 1

gcloud components update --version 282.0.0

Upvotes: 0

George
George

Reputation: 1516

This particular use of the gcloud command is deprecated: gcloud docker is not supported for Docker client versions above 18.03. You may check for related information on the gcloud docker documentation page.

At the end, in order to push the docker image into the registry with the latest version of gcloud and docker version 19.X the command will be:

docker push gcr.io/<PROJECT_ID>/<PROJECT_NAME>:<TAG>

Upvotes: 3

orangutan
orangutan

Reputation: 51

gcloud auth configure-docker
docker push gcr.io/devtest/pipeline:2.0.1

With the first command, you have already configured docker to use gcloud as the credential helper. Then you can just use docker as you would for any other registries.

Upvotes: 5

Dieter Van de Walle
Dieter Van de Walle

Reputation: 153

I have the same problem, but gcloud docker --authorize-only also crashes with the same error.

I suspect this is related to python version incompatibilities.

Upvotes: 1

Ramil Israfilov
Ramil Israfilov

Reputation: 9

gcloud docker --authorize-only
docker push gcr.io/devtest/pipeline:2.0.1

Upvotes: 0

Related Questions