Dockyard

repository·main·Indexed 43 days ago

https://github.com/ropali/dockyard

A modern, fast Docker client for Linux and macOS built with Rust, Tauri, and React.js. It provides a graphical interface for managing containers, volumes, networks, and Docker Compose projects with real-time statistics, integrated terminal access, and support for Docker version 27.1.1 or higher.

Tokens
10.1K
Snippets
46
Records
53
Agent score
55%

What's inside Dockyard

  1. How Docker Compose integration works

    main

    Dockyard automatically detects and groups containers created with Docker Compose. It uses specific Docker labels to provide an enhanced management experience:

    • Project Grouping: Uses the com.docker.compose.project label to group containers into collapsible dropdowns.
    • Service Information: Uses the com.docker.compose.service label to display the specific service name from your docker-compose.yml.
    • Bulk Operations: A "Compose" button in the top bar allows you to expand or collapse all Docker Compose groups simultaneously.
    • Status Overview: Each group displays a summary of running containers versus the total number of containers in that project.
  2. Install Dockyard on Linux using .deb

    main

    To install Dockyard on Debian-based Linux distributions, download the .deb package from the GitHub Releases page and use dpkg to install it. If you encounter missing dependency errors, run the fix command provided below.

    # Download the latest .deb package (replace vX.Y.Z with the actual version)
    wget https://github.com/ropali/dockyard/releases/download/vX.Y.Z/dockyard_X.Y.Z_amd64.deb
    
    # Install the package
    sudo dpkg -i dockyard_X.Y.Z_amd64.deb
    
    # If there are missing dependencies, run
    sudo apt-get install -f
  3. Install Dockyard using AppImage

    main

    For a portable installation on Linux, you can use the AppImage format. Download the release, grant execution permissions, and run the file directly.

    # Download the latest release (replace vX.Y.Z with the actual version)
    wget https://github.com/ropali/dockyard/releases/download/vX.Y.Z/dockyard-X.Y.Z.AppImage
    
    # Make it executable
    chmod +x dockyard-X.Y.Z.AppImage
    
    # Run Dockyard
    ./dockyard-X.Y.Z.AppImage
  4. Build Dockyard from source

    main

    To build Dockyard from the source code, ensure you have the prerequisites installed (Tauri, Docker >=27.1.1, Node.js >= v20.11.1, and Rust >= 1.79.0).

    # Clone the repository
    git clone https://github.com/ropali/dockyard.git
    cd dockyard
    
    # Install dependencies
    npm install
    
    # Build the Rust backend
    cargo build --release
    
    # Run the app in development mode
    npm run tauri dev
  5. Use the Icon component library

    main

    The src/Icons module provides a collection of React components for rendering SVG icons. Each icon component accepts IconProps, which extends React.SVGProps<SVGSVGElement>. This allows you to pass standard SVG attributes such as className, style, onClick, width, height, and fill directly to the icon.

    By default, icons are sized at 1em and use currentColor for their fill or stroke, making them easy to style via CSS or parent text color.

    import { IconSearch, IconDocker } from './Icons';
    
    function MyComponent() {
      return (
        <div>
          <IconSearch className="text-blue-500" />
          <IconDocker style={{ fontSize: '2rem' }} />
        </div>
      );
    }
  6. Manage container state with ContainerProvider and useContainers

    main

    Dockyard provides a React Context system to manage the global state of containers. To use this state in your application, you must wrap your component tree with the ContainerProvider. You can then access the containers, the currently selected container, and methods to manipulate them using the useContainers hook.

    Note: Calling useContainers outside of a ContainerProvider will throw an error.

    import { ContainerProvider, useContainers } from './path/to/ContainerContext';
    
    function App() {
      return (
        <ContainerProvider>
          <MyComponent />
        </ContainerProvider>
      );
    }
    
    function MyComponent() {
      const { containers, isLoading, loadContainers } = useContainers();
    
      if (isLoading) return <div>Loading...</div>;
    
      return (
        <button onClick={loadContainers}>
          Load {containers.length} Containers
        </button>
      );
    }
  7. Resolve macOS security/quarantine issues

    main

    Due to Apple's security policies, you may need to manually authorize Dockyard.

    Method 1: System Settings

    1. Attempt to open the app and click Cancel when the warning appears.
    2. Go to System Preferences -> Security & Privacy.
    3. Click Open Anyway and then Open in the pop-up window.

    Method 2: Terminal (for higher macOS versions or if the app is flagged as damaged) Run the following command to remove the quarantine attribute:

    sudo xattr -d com.apple.quarantine /Applications/dockyard.app/
  8. Prerequisites for Dockyard

    main

    Before installing or building Dockyard, ensure your environment meets these requirements:

    • OS: Linux or macOS
    • Docker: Version 27.1.1 or higher, must be installed and running.
    • Development (for building from source):
      • Tauri
      • Node.js >= v20.11.1
      • Rust >= 1.79.0
  9. Get available terminals with get_available_terminals

    main

    The get_available_terminals command returns a list of application names for terminal emulators available on the user's current operating system. The command automatically detects the host OS (Windows, macOS, or Linux) and filters the supported terminal variants accordingly. This is useful for populating selection menus or verifying terminal support within the Dockyard application.

    // As a Tauri command, this is invoked from the frontend via invoke()
    // Example JS/TS usage:
    // const terminals = await invoke('get_available_terminals');
    // console.log(terminals); // e.g., ['iterm2', 'alacritty', 'kitty']
  10. Configure the ImagesProvider

    main

    The ImagesProvider component manages the state for images by communicating with the Tauri backend via the list_images command. Wrap your application (or a specific sub-tree) with ImagesProvider to enable image state management via the useImages hook.

    import { ImagesProvider } from './path/to/ImagesContext';
    
    function App() {
      return (
        <ImagesProvider>
          <YourApplicationComponents />
        </ImagesProvider>
      );
    }
  11. List Docker volumes with list_volumes

    main

    The list_volumes command retrieves a list of all available Docker volumes. It returns a VolumeListResponse containing the volume data. This command is an asynchronous Tauri command that interacts with the Docker daemon via the application state.

    // Returns Result<VolumeListResponse, String>
    let volumes = await invoke('list_volumes');
  12. Manage container lifecycle operations

    main

    The container_operation command allows you to perform various lifecycle and utility actions on a container using the op_type parameter.

    Supported op_type values:

    • start: Starts a stopped container.
    • stop: Stops a running container.
    • restart: Restarts a container.
    • web: Attempts to open the container's first public port in the default web browser.
    • exec: Opens a terminal to execute commands inside the container.

    Parameters:

    • container_name: The name or ID of the target container.
    • op_type: The string identifier for the operation to perform.
    // Example: Starting a container
    // await invoke('container_operation', { containerName: 'my_app', opType: 'start' });