mirror of
https://github.com/fosrl/newt.git
synced 2026-03-09 07:12:28 -05:00
[PR #46] [MERGED] 🐳 Add Docker Socket Integration #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/46
Author: @improbableone
Created: 5/29/2025
Status: ✅ Merged
Merged: 6/3/2025
Merged by: @oschwartz10612
Base:
dev← Head:hub-dev📝 Commits (2)
4cf83f4docker socket9f006b1Update packages📊 Changes
4 files changed (+226 additions, -13 deletions)
View changed files
➕
docker/client.go(+166 -0)📝
go.mod(+3 -3)📝
go.sum(+6 -6)📝
main.go(+51 -4)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
This PR adds Docker socket integration to Newt, enabling remote inspection of Docker containers. This functionality allows Pangolin to query and retrieve information about Docker containers running on the Newt client side.
✨ What's New
🔧 Technical Changes
New Files
CheckSocket()function to verify Docker socket availabilityListContainers()function to retrieve comprehensive container informationContainer,Port, andNetworkdataModified Files
main.go:
DOCKER_SOCKETenvironment variablenewt/socket/checkandnewt/socket/fetchcommandsgo.mod: Added Docker SDK dependencies:
github.com/docker/docker- Official Docker SDK for Go🔌 WebSocket API
Two new WebSocket message handlers:
newt/socket/check: Responds with Docker socket availability statusnewt/socket/fetch: Returns detailed list of all Docker containers with full network information🛠️ Configuration
DOCKER_SOCKET(defaults to docker.sock)🎯 Use Cases
This enhancement enables Pangolin to:
How to test?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.