Skip to content

docker push --quiet suppresses errors and non-zero exit code #2284

Description

@thaJeztah

(as commented by @BarakBD-Globality in moby/moby#36655 (comment))

The docker push --quiet option was implemented in #2197 (not in a release yet), but appears to not print errors and returns a zero exit code on failure;

Without --quiet

$ docker push nosuchimage
The push refers to repository [docker.io/library/nosuchimage]
An image does not exist locally with the tag: nosuchimage

echo $?
1

$ docker push busybox
The push refers to repository [docker.io/library/busybox]
195be5f8be1d: Layer already exists
[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. Please contact admins of the docker.io registry NOW to avoid future disruption. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/
errors:
denied: requested access to the resource is denied
unauthorized: authentication required

echo $?
1

With --quiet:

$ docker push --quiet nosuchimage
docker.io/library/nosuchimage

$ echo $?
0

$ docker push --quiet busybox
docker.io/library/busybox

$ echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions