Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

get docker image details like date

Mohan Kona October 26, 2024

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.

 

definitions:
  services:
    frontend:
       image:
          name: my-image:latest

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events