Skip to content

Add detailed Docker container information to pre/post test run commands#7222

Merged
davidfowl merged 1 commit intomainfrom
dev/karolz/better-docker-diag
Jan 23, 2025
Merged

Add detailed Docker container information to pre/post test run commands#7222
davidfowl merged 1 commit intomainfrom
dev/karolz/better-docker-diag

Conversation

@karolz-ms
Copy link
Copy Markdown
Contributor

The detailed info includes network connections in particular, which will help us diagnose lingering "default-aspire-network" networks.

The detailed info includes network connections in particular, which will help us diagnose lingering "default-aspire-network" networks.

<ItemGroup Condition="'$(HasDocker)' == 'true'">
<HelixPreCommand Include="docker info" />
<HelixPreCommand Include="docker ps" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docker ps is the same as docker container ls

<ItemGroup Condition="'$(HasDocker)' == 'true'">
<HelixPreCommand Include="docker info" />
<HelixPreCommand Include="docker ps" />
<HelixPreCommand Include="docker container ls --all" />
Copy link
Copy Markdown
Contributor Author

@karolz-ms karolz-ms Jan 23, 2025

Choose a reason for hiding this comment

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

Leaving both table and JSON output from docker container ls because non-JSON (table) output is easy on the eyes (allows to quickly check if something was left hanging).

Copy link
Copy Markdown
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@davidfowl davidfowl merged commit 689e46e into main Jan 23, 2025
@davidfowl davidfowl deleted the dev/karolz/better-docker-diag branch January 23, 2025 22:36
@davidfowl
Copy link
Copy Markdown
Contributor

MERGE

@davidfowl
Copy link
Copy Markdown
Contributor

This isn't working. I think json needs a format string:

+ docker container ls --all
CONTAINER ID   IMAGE                                      COMMAND                  CREATED         STATUS              PORTS                                  NAMES
c94768dfe4b4   netaspireci.azurecr.io/library/mysql:9.1   "docker-entrypoint.s…"   2 minutes ago   Up About a minute   33060/tcp, 127.0.0.1:32777->3306/tcp   mysql-mbjdygyh-1738eb45
067d8f5f5077   netaspireci.azurecr.io/library/mysql:9.1   "docker-entrypoint.s…"   2 minutes ago   Up 2 minutes        33060/tcp, 127.0.0.1:32776->3306/tcp   mysql-knrwwswm-44824032
6e6d2f6561fa   netaspireci.azurecr.io/library/mysql:9.1   "docker-entrypoint.s…"   5 minutes ago   Up 5 minutes        33060/tcp, 127.0.0.1:32770->3306/tcp   mysql-uewfphku-42c6c8b9
+ docker container ls --all --format json
json
json
json

@davidfowl
Copy link
Copy Markdown
Contributor

davidfowl commented Jan 25, 2025

Hmm running locally it works, I don't know why helix is printing the text "json".

@github-actions github-actions Bot locked and limited conversation to collaborators Feb 24, 2025
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants