Docker Dashboard

repository·master·Indexed 43 days ago

https://github.com/rakibtg/docker-web-gui

A simple GUI interface for managing Docker containers, images, and volumes. It provides a web-based dashboard to start, stop, restart, and delete containers, view real-time resource consumption stats (CPU, memory, network I/O), retrieve logs, and manage container groups without using the terminal.

Tokens
5.6K
Snippets
26
Records
32
Agent score
55%

What's inside Docker Dashboard

  1. Overview of Docker Dashboard features

    master

    Docker Dashboard provides a GUI for managing Docker resources without using the terminal. Key capabilities include:

    • Container Management: Instantly start, stop, restart, delete, and view logs for containers. Filter containers by running status.
    • Grouping: Create groups of containers and perform bulk actions on them.
    • Monitoring: View live system consumption statistics for active containers.
    • Image & Volume Management: Run or delete images, and prune Docker images, containers, volumes, and the entire Docker system.
  2. Build the client for production

    master
    Use npm run build to create a production-ready version of the app. This command bundles React in production mode, optimizes the build for performance, minifies files, and includes hashes in filenames for cache busting. The output is placed in the build folder.
    npm run build
  3. Manage the client application with npm scripts

    master

    The client application provides several npm scripts for development, testing, and production builds. Run these commands from the client directory.

    # Install dependencies
    npm install
    
    # Run in development mode
    npm start
    
    # Run tests in interactive watch mode
    npm test
    
    # Build for production
    npm run build
    
    # Eject from Create React App configuration
    npm run eject
  4. Install and run Docker Dashboard via Node.js

    master

    To run the application directly on your host machine, ensure you have node and npm installed. The application will automatically install required node modules when you run the entry point.

    1. Clone the repository:
      git clone git@github.com:rakibtg/docker-web-gui.git
    2. Navigate to the directory:
      cd ./docker-web-gui
    3. Run the application:
      node app.js
    4. Access the GUI at http://localhost:3230/.
    git clone git@github.com:rakibtg/docker-web-gui.git
    cd ./docker-web-gui
    node app.js
  5. Run Docker Dashboard without Docker Compose

    master

    If you are not using Docker Compose, use the following standard Docker commands to build and run the image. Note the volume mounts required to allow the container to interact with the host's Docker daemon and binary.

    # Build the image
    docker build . -t docker-web-gui
    
    # Run the image
    docker run -p 3230:3230 -v /usr/local/bin/docker:/usr/local/bin/docker -v /var/run/docker.sock:/var/run/docker.sock docker-web-gui
  6. Start the Docker Web GUI application

    master

    To start the application, run the app.js entrypoint. The application automatically checks for required dependencies in the /backend/node_modules directory. If they are missing, it will attempt to install them automatically using safeTerminal.installModules before starting the server. Once initialized, the application serves the backend and provides access to the GUI via a web browser.

    By default, the application is accessible at http://localhost:3230.

    node app.js
  7. Deploy docker-web-gui using Docker Compose

    master

    To run the Docker Dashboard, use the provided docker-compose.yml file. This configuration builds the image from the local context and maps the necessary ports and volumes to allow the GUI to interact with your Docker daemon.

    Key Configuration Details:

    • Port Mapping: The application is exposed on host port 3230 (mapped to container port 3230).
    • Docker Socket: The host's /var/run/docker.sock is mounted into the container. This is required for the GUI to manage your Docker containers.
    • Restart Policy: Set to always to ensure the dashboard automatically starts on system boot or restarts if the container fails.
    version: "3"
    
    services:
      docker-web-gui:
        container_name: docker-web-gui
        build:
          context: .
        ports:
          - "3230:3230"
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
        restart: always
  8. Manage Docker images

    master

    List Images

    Retrieve a list of all available Docker images via GET /api/image/fetch.

    Execute Image Commands

    Run commands like run or rmi on a specific image using GET /api/image/command.

    Query Parameters for commands:

    • image (required): The ID of the image.
    • command (required): The command to execute (e.g., run, rmi).
    GET /api/image/command?image=3da3ad7b90e3&command=run