Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DockerNav - A Terminal UI for Docker Management

DockerNav logo

Go version Project status License

DockerNav is a terminal-based user interface for managing Docker resources. Built with Go and the Charm libraries (Bubbletea, Bubbles, Lipgloss), it provides an intuitive TUI to manage containers, images, networks, volumes, and system information without leaving your terminal.

Table of Contents

Features

  • Container Management: Create, start, stop, restart, remove, and view logs of containers
  • Image Management: Pull, list, and remove Docker images
  • Network Management: Create, list, inspect, and remove Docker networks
  • Volume Management: Create, list, inspect, and remove Docker volumes
  • System Information: View Docker system information, version, and disk usage
Feature Screenshots (click to expand)

Main Menu Main Menu

Container Management Main Menu

Image Management Main Menu

Logs of Container Main Menu

Installation

Prerequisites

  • Go 1.23 or higher
  • Docker Engine running on your system

From Source

# Clone the repository
git clone https://github.com/Gostatsog/dockerNav.git
cd dockerNav

# Build the application
make build-mac    # For macOS
make build-linux  # For Linux

# Alternatively, you can install directly
make install

Binary Releases

You can download pre-built binaries from the releases page.

Usage

Start DockerNav by running:

dockerNav

Navigation

  • Use numbers 1-5 to navigate between different views
  • Press m to return to the main menu from any view
  • Press q or Ctrl+C to quit the application

Keyboard Shortcuts

Key Action
r Refresh current view
esc Go back / Cancel action
m Return to main menu
q Quit application
Container Management Shortcuts
Key Action
a Start container
s Stop container
t Restart container
l View container logs
c Create new container
x Remove container
Image Management Shortcuts
Key Action
p Pull new image
x Remove image
Network Management Shortcuts
Key Action
i Inspect network
c Create new network
x Remove network
Volume Management Shortcuts
Key Action
i Inspect volume
c Create new volume
x Remove volume
System Management Shortcuts
Key Action
1-4 Switch between system views
p Prune system

Architecture

DockerNav follows a clean architecture with separation of concerns. Here's an overview of the project structure:

dockerNav/
├── cmd/
│   └── dockerNav/         # Application entry point
├── internal/
│   ├── client/            # Docker client wrapper
│   └── ui/                # Terminal UI components
├── pkg/
│   └── formatter/         # Utility functions for formatting
└── Makefile               # Build automation

Component Diagram

graph TD
    A[Main] --> B[Main Model]
    B --> C[Container Model]
    B --> D[Image Model]
    B --> E[Network Model]
    B --> F[Volume Model]
    B --> G[System Model]
    C & D & E & F & G --> H[Docker Client]
    H --> I[Docker Engine API]
Loading

UI State Flow

stateDiagram-v2
    [*] --> MainMenu
    MainMenu --> Containers: Press 1
    MainMenu --> Images: Press 2
    MainMenu --> Networks: Press 3
    MainMenu --> Volumes: Press 4
    MainMenu --> System: Press 5
    
    Containers --> MainMenu: Press m/0
    Images --> MainMenu: Press m/0
    Networks --> MainMenu: Press m/0
    Volumes --> MainMenu: Press m/0
    System --> MainMenu: Press m/0
    
    Containers --> ContainerAction: Select action
    ContainerAction --> Containers: Complete/Cancel
    
    Images --> ImageAction: Select action
    ImageAction --> Images: Complete/Cancel
    
    Networks --> NetworkAction: Select action
    NetworkAction --> Networks: Complete/Cancel
    
    Volumes --> VolumeAction: Select action
    VolumeAction --> Volumes: Complete/Cancel
    
    MainMenu --> [*]: Press q
Loading

Development

Building from Source

# Clone the repository
git clone https://github.com/Gostatsog/dockerNav.git
cd dockerNav

# Build the application
make

Available Make Commands

  • make: Build binaries for both macOS and Linux
  • make build-mac: Build only for macOS
  • make build-linux: Build only for Linux
  • make clean: Remove build artifacts
  • make test: Run tests
  • make lint: Run linter
  • make run: Build and run the application
  • make install: Install to GOPATH/bin

Project Structure

Detailed Project Structure
dockerNav/
├── cmd/
│   └── dockerNav/
│       └── main.go            # Application entry point
├── go.mod                     # Go module definition
├── go.sum                     # Go module checksum
├── internal/
│   ├── client/
│   │   └── docker.go          # Docker client wrapper
│   └── ui/
│       ├── containers.go      # Container UI model
│       ├── container_create.go # Container creation form
│       ├── image_model.go     # Image UI model
│       ├── main.go            # Main UI model
│       ├── network_model.go   # Network UI model
│       ├── styles.go          # UI styling definitions
│       ├── system_model.go    # System UI model
│       └── volume_modal.go    # Volume UI model
├── Makefile                   # Build automation
└── pkg/
    └── formatter/
        ├── formatters.go      # Utility formatting functions

Key Components

Docker Client

The internal/client/docker.go file wraps the Docker SDK to provide a simplified interface for interacting with the Docker Engine:

// DockerClient wraps the Docker client SDK
type DockerClient struct {
    Client *client.Client
    Ctx    context.Context
}

UI Models

Each section of the application is managed by a dedicated model implementing the Bubble Tea model interface:

type Model interface {
    Init() tea.Cmd
    Update(msg tea.Msg) (Model, tea.Cmd)
    View() string
}

Main Model

The main model coordinates between different views and manages the overall application state:

type MainModel struct {
    dockerClient   *client.DockerClient
    currentView    View
    containers     *ContainerModel
    images         *ImageModel
    networks       *NetworkModel
    volumes        *VolumeModel
    system         *SystemModel
    // ... other fields
}

Dependencies

DockerNav relies on several libraries:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments

  • Charm for their amazing terminal UI libraries
  • Docker for their comprehensive API

Note: This project is currently in alpha stage. Some features might not work as expected.

For support, please open an issue on GitHub.

About

Cli docker navigator made with Go

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages