Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: print Docker Info labels in banner #2681

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

mdelapenya
Copy link
Collaborator

@mdelapenya mdelapenya commented Aug 5, 2024

What does this PR do?

It captures the Docker labels returned by the calls to docker info, and adds them to the initial banner:

Sample output:

2024/08/05 13:16:51 github.com/testcontainers/testcontainers-go - Connected to docker: 
  Server Version: 26.1.4 (via Testcontainers Desktop 1.15.1)
  API Version: 1.45
  Operating System: Docker Desktop
  Total Memory: 7841 MB
  Labels:
    com.docker.desktop.address=unix:///Users/mdelapenya/Library/Containers/com.docker.docker/Data/docker-cli.sock
  Testcontainers for Go Version: v0.33.0
  Resolved Docker Host: tcp://127.0.0.1:50211
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: f15d9d974dddf9f2151699b9b87ae005de5b0d208c9911f666e1b821b106c735
  Test ProcessID: 3a9b55d9-47e5-42f7-9940-db2843dfe504

If there are no labels, no entry will be added to the banner.

Why is it important?

Display more info about the server

Follow-ups

Do we want to present an empty list of labels, or simply skip that entry of there are no labels?

@mdelapenya mdelapenya requested a review from a team as a code owner August 5, 2024 11:21
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Aug 5, 2024
@mdelapenya mdelapenya self-assigned this Aug 5, 2024
Copy link

netlify bot commented Aug 5, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit bcf5d27
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/66b0b5c01d61f9000811c4ee
😎 Deploy Preview https://deploy-preview-2681--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya merged commit b78a351 into testcontainers:main Aug 5, 2024
112 checks passed
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 6, 2024
* main:
  chore: print Docker Info labels in banner (testcontainers#2681)
  fix: incorrect parsing of exposedPorts in readiness check (testcontainers#2658)
  feat: add grafana-lgtm module (testcontainers#2660)
  Added valkey module (testcontainers#2639)
  fix: container.Endpoint and wait.FortHTTP to use lowest internal port (testcontainers#2641)
mdelapenya added a commit that referenced this pull request Aug 7, 2024
* main:
  fix: missing image build errors (#2651)
  test: fix image label test (#2689)
  chore(deps): bump github.com/docker/docker from 27.0.3+incompatible to 27.1.0+incompatible (#2682)
  chore: print Docker Info labels in banner (#2681)
  fix: incorrect parsing of exposedPorts in readiness check (#2658)
@mdelapenya mdelapenya deleted the log-info-labels branch September 10, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant