Skip to content

Validate docker image before uploading to registry#21916

Merged
wangxin merged 3 commits intosonic-net:masterfrom
yutongzhang-microsoft:yutongzhang/validate_image
Mar 14, 2025
Merged

Validate docker image before uploading to registry#21916
wangxin merged 3 commits intosonic-net:masterfrom
yutongzhang-microsoft:yutongzhang/validate_image

Conversation

@yutongzhang-microsoft
Copy link
Contributor

@yutongzhang-microsoft yutongzhang-microsoft commented Mar 4, 2025

Why I did it

Before pushing the newly built docker image to the registry, we add a verification step to ensure the image is valid.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Before pushing the newly built Docker image to the registry, we add a verification step to ensure the image is valid.

How to verify it

For ref https://dev.azure.com/mssonic/build/_build/results?buildId=794495&view=results
If the validate step fails, it won't push the image to registry.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yutongzhang-microsoft yutongzhang-microsoft force-pushed the yutongzhang/validate_image branch from db26cfd to 4ad1944 Compare March 10, 2025 03:34
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

1 similar comment
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

cd ../
docker rm -f sonic-mgmt

./setup-container.sh -n sonic-mgmt -d /data -i docker-sonic-mgmt -v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about run something inside the docker to verify that the sonic-mgmt container is actually running?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add docker exec sonic-mgmt bash -c "echo 'Container is running' && ps aux" to verify. If the container is not running, this command will fail.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin merged commit e959d77 into sonic-net:master Mar 14, 2025
12 checks passed
@yutongzhang-microsoft yutongzhang-microsoft deleted the yutongzhang/validate_image branch March 14, 2025 03:30
wangxin pushed a commit that referenced this pull request Mar 24, 2025
Why I did it
Same as #21916, before pushing the newly built docker image to the registry, we add a verification step to ensure the image is valid.

How I did it
Same as #21916, before pushing the newly built docker image to the registry, we add a verification step to ensure the image is valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants