Home > Mobile >  Using latest Docker image in BitBucket pipe command
Using latest Docker image in BitBucket pipe command

Time:07-27

I have a Bitbucket pipeline that runs a pipe using a version number tag as follows:

script:
        - mkdir meta
        - pipe: myteam/bladepackager-pipeline:1.0.8
          variables: ...

I would prefer to have it automatically resolve the latest tagged version of the Docker image, so I tried:

script:
        - mkdir meta
        - pipe: myteam/bladepackager-pipeline:latest
          variables: ...

But I get an error message from my BitBucket pipeline run that says

Your pipe name is in an invalid format. Check the name of the pipe and try again.

Is there a way to specify latest rather than a specific tag?

CodePudding user response:

The tag latest, itself is a tag, it does not mean the latest tag. so if you want to use images with this tag, you have to make docker with that tag.

CodePudding user response:

The

- pipe: aaa/bbbb:1.2.3

syntax refers to a git repository hosted in the bitbucket, e.g. bitbucket.org/aaa/bbbb, whereas the

- pipe: docker://registry.example.com/aaa/bbbb:tag

refers to a docker image in any registry.

The :latest tag can only be used with the docker syntax. For the bare pipe syntax I guess you can only try git refs? Maybe :main or :master would be valid? Never managed it to work, please reach back if you succeed.

  • Related