docker push missing the --all-tags option
Asked by Jason Harrison:

I have a bitbucket-pipeline based on python 3.6.9 which according to

```
docker --version
```

provides

```
docker: Docker version 19.03.15, build 99e3ed8
```

however this version of docker does not have the option for push --all-tags.

```
docker push --help

Usage: docker push [OPTIONS] NAME[:TAG]

Push an image or a repository to a registry

Options:

--disable-content-trust Skip image signing (default true)
```

so this fails

```
docker push --all-tags 1234.dkr.ecr.us-west-2.amazonaws.com/repo-name
Pushing to ECR: repo-name:2.20.2
unknown flag: --all-tags
See 'docker push --help'.
```

<br />

However the --all-tags flag was introduced before docker version 10, so how is this possible? Is the only option to use the "pipe: atlassian/aws-ecr-push-image" or to push each tag separately?

Can I install an publically available version of docker?


Answers:
author: Caroline R
body: Hi, [@Jason Harrison](/t5/user/viewprofilepage/user-id/4055349)! Thank you for reaching out to Atlassian Community!

Indeed, this version doesn't have the ability to do "docker push --all-tags".

In this case, you can upgrade the client version of docker yourself by either using an appropriate image or by downloading and installing the newer version as a build step.

Example image with dockerv20 client:

    pipelines:  default:    - step:        image: atlassian/pipelines-docker-daemon:v20-stable        services:        - docker        script:        - docker version

Example install of dockerv20 into any existing image (also works on default image):

    pipelines:  default:    - step:        services:          - docker        script:          - curl -s -O https://download.docker.com/linux/static/stable/x86_64/docker-20.10.5.tgz          - tar --extract --file=docker-20.10.5.tgz          - ls -al ./docker          - export PATH=./docker:$PATH          - which docker          - docker version

We already have a feature request to upgrade Docker client default from v19 to v20 as you can see here:

* <https://jira.atlassian.com/browse/BCLOUD-21222>

I would suggest that you add your vote there (by selecting the **Vote for this issue** link) as the number of votes helps the development team and product managers better understand the demand for new features.

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

I hope this helps, but do let me know if you have any questions.

Kind regards,  
Caroline

comments: author: David Beltr?n
body: Hi Caroline,  

Can you further elaborate in the "using an appropriate image" approach?  
I'm using a custom alpine-based image which contains an updated version of docker-cli and then in a pipeline which looks something like this:  

```
image:
  name: "<account>.dkr.ecr.us-east-1.amazonaws.com/my-v20-image:version"

definitions:
  steps:
    - step: &docker-test-version
        name: Docker test version
        services:
          - docker
        script:
          - apk info docker-cli
          - docker version
          - which docker
```

The output shows this:

```
+ apk info docker-cli
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: No such file or directory
docker-cli-20.10.11-r0 description:
Docker CLI
docker-cli-20.10.11-r0 webpage:
https://www.docker.io/
docker-cli-20.10.11-r0 installed size:
50 MiB

+ docker version
Client: Docker Engine - Community
Version: 19.03.15
API version: 1.40
Go version: go1.13.15
Git commit: 99e3ed8
Built: Sat Jan 30 03:11:43 2021
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 20.10.5
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 363e9a8
Built: Tue Mar 2 20:18:31 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.19.0
GitCommit: de40ad0


+ which docker
/usr/bin/docker
```

So even when using an image that comes with the Docker CLI updated to v20, Bitbucket Pipelines somehow overwrites the binary to a v19 one.


author: Caroline R
body: Hi, David.

We used the image **atlassian/pipelines-docker-daemon:v20-stable** in the build Pipeline and we do see that client and server are both version 20.

You informed you are using your own image that contains an updated version of docker. However, the docker version command gives the client version as 19.03.15 in the Pipeline.

In this case, could you please run the image **\<account\>.dkr.ecr.us-east-1.amazonaws.com/my-v20-image:version** locally and check the version of Docker client and server using the docker version command?

Also, could you please share the Dockerfile used to create the **image \<account\>.dkr.ecr.us-east-1.amazonaws.com/my-v20-image:version**?

Thank you.

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud

docker