Skip to content

Commit

Permalink
Fix docker image tag detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Jul 1, 2024
1 parent 6f361a5 commit 2887eb6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pipeline/init_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ def get_image_info():
client = docker.APIClient(base_url='unix://var/run/docker.sock')
container_id = socket.gethostname()
container_info = client.inspect_container(container=container_id)
image_info = container_info['Image'].split("@")
image_info = container_info["Config"]['Image'].split("@")
if len(image_info) == 2:
return image_info
elif len(image_info) == 1:
image_data = client.inspect_image(image=image_info[0])
image_sha256 = image_data['RepoDigests'][0].split("@")[1]
if len(image_info) == 2:
return image_info[0], image_sha256
return image_info[0], image_sha256
return None


Expand Down

0 comments on commit 2887eb6

Please sign in to comment.