Skip to content

Commit

Permalink
chore: print Docker Info labels in banner (#2681)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya authored Aug 5, 2024
1 parent 9e8d4e7 commit b78a351
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,27 @@ func (c *DockerClient) Info(ctx context.Context) (system.Info, error) {
Server Version: %v
API Version: %v
Operating System: %v
Total Memory: %v MB
Total Memory: %v MB%s
Testcontainers for Go Version: v%s
Resolved Docker Host: %s
Resolved Docker Socket Path: %s
Test SessionID: %s
Test ProcessID: %s
`
infoLabels := ""
if len(dockerInfo.Labels) > 0 {
infoLabels = `
Labels:`
for _, lb := range dockerInfo.Labels {
infoLabels += "\n " + lb
}
}

Logger.Printf(infoMessage, packagePath,
dockerInfo.ServerVersion, c.Client.ClientVersion(),
dockerInfo.ServerVersion,
c.Client.ClientVersion(),
dockerInfo.OperatingSystem, dockerInfo.MemTotal/1024/1024,
infoLabels,
internal.Version,
core.ExtractDockerHost(ctx),
core.ExtractDockerSocket(ctx),
Expand Down

0 comments on commit b78a351

Please sign in to comment.