🐳 Add Docker Socket Integration #1435

Closed
opened 2026-04-05 19:28:24 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @improbableone on 5/29/2025

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 introduces Docker socket integration functionality that allows the system to communicate with Docker (for now) containers running on remote hosts through the Newt.

I have raised a corresponding PR for newt as well.

Backend Changes

  • Added caching mechanism for Docker socket data with 1-hour TTL

  • Implemented fetchContainers() and dockerSocket() functions for communication with Newt clients

  • Integrated with existing WebSocket messaging system

  • Socket Integration API (socketIntegration.ts)

    • Added Docker socket related endpoints
    • Defined TypeScript interfaces for containers, networks, and ports
    • Implemented real-time container status monitoring
  • Database Schema Updates

    • Added dockerSocketEnabled boolean field to sites table
    • Enables per-site Docker socket functionality control

Frontend Changes

  • Custom React hook for managing Docker socket connections
  • Handle container fetching, status polling, and error management
  • Rich table-based UI for browsing and selecting Docker containers

Integration Points

  • Resource Info: Updated resource info boxes and layouts to show Docker socket integration
  • Site Settings: Added Docker socket configuration to site general settings
  • Proxy Configuration: Added a container selection button for adding targets.

How to Test?

  • do the database migrations so that the new column is added.
  • start pangolin.
  • Create a new site based on newt
  • In site settings, turn on Docker Socket
  • Build the corresponding newt PR branch for newt configuration and run it with above site.

Site Settings
Selector Button
Containers List

*Originally created by @improbableone on 5/29/2025* ## 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 introduces Docker socket integration functionality that allows the system to communicate with Docker (for now) containers running on remote hosts through the Newt. I have raised a corresponding [PR](https://github.com/fosrl/newt/pull/46) for newt as well. #### Backend Changes - Added caching mechanism for Docker socket data with 1-hour TTL - Implemented `fetchContainers()` and `dockerSocket()` functions for communication with Newt clients - Integrated with existing WebSocket messaging system - **Socket Integration API** (socketIntegration.ts) - Added Docker socket related endpoints - Defined TypeScript interfaces for containers, networks, and ports - Implemented real-time container status monitoring - **Database Schema Updates** - Added `dockerSocketEnabled` boolean field to sites table - Enables per-site Docker socket functionality control #### Frontend Changes - Custom React hook for managing Docker socket connections - Handle container fetching, status polling, and error management - Rich table-based UI for browsing and selecting Docker containers #### Integration Points - **Resource Info**: Updated resource info boxes and layouts to show Docker socket integration - **Site Settings**: Added Docker socket configuration to site general settings - **Proxy Configuration**: Added a container selection button for adding targets. ## How to Test? - do the database migrations so that the new column is added. - start pangolin. - Create a new site based on [newt](https://github.com/fosrl/newt/pull/46) - In site settings, turn on Docker Socket - Build the corresponding `newt` PR branch for newt configuration and run it with above site. ![Site Settings](https://github.com/user-attachments/assets/3f14a9d1-512a-475c-a8f3-09e40ce787c0) ![Selector Button](https://github.com/user-attachments/assets/c1094286-3bc5-4a95-8a9f-d216bef3c65f) ![Containers List](https://github.com/user-attachments/assets/530429c3-f4c6-497d-a9f8-e69a5cb13367)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1435