Specify Docker tag when creating release


I’m pushing images to Docker Hub and download them during the Run Container step. When creating the release in my build pipeline, how can I tell the release to download the specified version of the image?
Is there any variable that I can use in “RUN A DOCKER CONTAINER” step when specifying Package ID?
<org>/<package>:#{Variable passed from OctopusCreateRelease step or 'latest' if not explicitly set}

Finding release template…
The package version for some steps was not specified. Going to try and resolve those automatically…
Finding latest package for step: Run container
<-- Wrong package selected -->
Selected ‘/’ version ‘1.0.0-docker-env.173166.0’ for ‘Run container’
Using version number provided on command-line: 1.0.0-alpha.0.21
Release plan for **** 1.0.0-alpha.0.21
Channel: '
***’ (this is the default channel)
# Name Version Source Version rules
— --------------- --------------------------- ------------------ -------------------
1 Run container 1.0.0-docker-env.173166.0 Latest available Allow any version

A package exists with same name as release but it’s not selected.


- task: OctopusCreateRelease@4
  enabled: 'true'
    OctoConnectedServiceName: '****'
    Space: 'Default'
    ProjectName: '$(octopusProject)'
    ReleaseNumber: '$(Build.BuildNumber)'
    Channel: '****'
    DeployToEnvironment: 'Dev'
    DeploymentProgress: true
    AdditionalArguments: --package $(ImageName}:$(Build.BuildNumber)
  displayName: 'Octopus release'

Hi @joakim.carselind,

Thanks for getting in touch!

The behaviour suggests that for some reason it is unable to match the packageName:Version in the additional arguments successfully.

You could try amending it and use StepName:Version instead to see if that provides better results.
Or, perhaps try --packageVersion=VALUE which sets the desired version for all packages in the release without having to specify individual packages/steps.


Thanks StepName:Version did the trick!

1 Like