I have defined a docker image in the the definitions, and in later in the steps, i want to verify the image(if its the latest one) using the creation date of the image.
Hi Mohan,
You would need to pull the image during the step and then use the docker inspect command, something like the following:
pipelines:
default:
- step:
services:
- docker
- frontend
script:
- docker pull my-image:latest
- docker inspect my-image:latest | grep -i created
definitions:
services:
frontend:
image:
name: my-image:latest
Please keep in mind though that if a newer version of that image is pushed between the time that the service's image is pulled when the step starts and the time that you pull the image during the step's script, then you'll get the creation date for the newer image and not the one Pipelines used in this step.
Kind regards,
Theodora
Join this webinar on June 25/26th to learn how to build secure CI/CD workflows using Bitbucket Pipelines and get tips from our own engineers on how to speed up builds and operate at scale.
Register today
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.