Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 1, 2025

Overview

This PR adds a new action to the PV CLI that installs or updates Docker on desktop machines. The action provides comprehensive support for multiple operating systems and CPU architectures, automatically detecting the environment and performing the appropriate installation or upgrade.

New in latest update: Users are now prompted to choose between Docker Desktop and Docker Engine on Linux systems, following official Docker documentation for each installation type.

Features

Interactive Installation Type Selection

macOS (Intel & Apple Silicon)

  • Automatically installs Docker Desktop via Homebrew (only option available on macOS)
  • Supports both x86_64 and ARM64 architectures
  • Updates existing installations using brew upgrade
  • Provides helpful guidance if Homebrew is not available

Linux

  • Interactive Prompt: Users are asked to choose between:
    • Docker Desktop: GUI application with Docker Engine included
    • Docker Engine: CLI and daemon only
  • Choice appears via an interactive form using charmbracelet/huh

Docker Desktop Installation (Linux)

Ubuntu

Debian

Fedora

Arch Linux

Docker Engine Installation (Linux)

Debian/Ubuntu

Fedora/CentOS/RHEL

Intelligent Operation

The action automatically:

  • Detects the operating system (macOS or Linux)
  • Identifies the CPU architecture (x86_64/amd64 or ARM64/aarch64)
  • Determines the Linux distribution (Ubuntu, Debian, Fedora, CentOS, RHEL, Arch)
  • Checks if Docker is already installed
  • Shows the current Docker version if present
  • Prompts user to choose installation type (Linux only)
  • Decides whether to perform a fresh installation or an update

Installed Components

  • Docker CLI: Command-line interface for Docker
  • Docker Engine/Desktop: Core Docker runtime
  • Docker Compose: Multi-container orchestration (v2 as plugin)
  • Docker Buildx: Extended build capabilities plugin
  • containerd: Industry-standard container runtime

Implementation

The action follows the PV CLI action pattern:

  • Self-contained package in internal/actions/docker/
  • Auto-registers via init() function
  • Appears as "Install/Update Docker" in the TUI menu
  • Uses structured logging for clear user feedback
  • Comprehensive error handling with descriptive messages
  • Interactive forms using charmbracelet/huh for user choices

Usage

Users select "Install/Update Docker" from the PV CLI menu. On Linux, they are prompted to choose between Docker Desktop and Docker Engine. The action then handles everything automatically based on their system configuration and choice.

Files Changed

  • main.go: Added import for the docker action package (3 lines)
  • internal/actions/docker/docker.go: New action implementation (708 lines)
  • go.mod & go.sum: Added charmbracelet/huh dependency for interactive forms

All changes follow Go best practices and pass go fmt, go vet, and go test checks. All installation methods follow official Docker documentation.

Original prompt

Create an action for installing docker cli, docker compose, docker desktop.. basically install docker on a dektop machine.

if docker is installed, update/upgrade it

this action should take care macos, different linux distros like debian and ubuntu.

this action should take care of different CPU arch, such as x86, arm.

Created from VS Code via the [GitHub Pull Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…pport

Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com>
Copilot AI changed the title [WIP] Create an action for... Add Docker installation/update action with multi-OS and multi-architecture support Oct 1, 2025
Copilot AI requested a review from munezaclovis October 1, 2025 06:31
@munezaclovis
Copy link
Contributor

@copilot Just in case, Please review the installation guide for docker straight from the docker website. here are the necessary links that contains instructions for each distro

Installing Docker desktop

Installing Docker engine

as you can see, most of the links are for Docker engine but the macOS link is for docker desktop. thats intended. I want that after a user selects the install docker action, they get a question asking which one they want. if they want docker desktop or docker engine.

…gine

Co-authored-by: munezaclovis <51137458+munezaclovis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 1, 2025

@copilot Just in case, Please review the installation guide for docker straight from the docker website. here are the necessary links that contains instructions for each distro

Installing Docker...

Implemented the interactive prompt to choose between Docker Desktop and Docker Engine. Changes in commit f796ca1:

How it works:

macOS: Automatically installs Docker Desktop via Homebrew (only option available)

Linux: Shows an interactive prompt using charmbracelet/huh:

Choose Docker installation type
Docker Desktop includes a GUI and Docker Engine. 
Docker Engine is CLI/daemon only.

> Docker Desktop (GUI application with Docker Engine)
  Docker Engine (CLI and daemon only)

Docker Desktop installations follow official docs:

  • Ubuntu/Debian: Downloads and installs .deb package from https://desktop.docker.com
  • Fedora: Downloads and installs .rpm package
  • Arch: Installs via yay AUR helper
  • Other distros: Shows error with manual installation link

Docker Engine installations follow official docs:

  • Ubuntu/Debian: Configures official apt repository and installs docker-ce
  • Fedora/CentOS/RHEL: Configures official dnf/yum repository and installs docker-ce

All installation methods follow the official Docker documentation linked in your comment.

TUI Menu

  🪄 PV CLI - Local Dev Environment Manager  

╭──────────────────────────────────────────────────╮
│ Search: (type to filter options)                 │
╰──────────────────────────────────────────────────╯

  > Install/Update Docker

Copilot AI changed the title Add Docker installation/update action with multi-OS and multi-architecture support Add Docker installation/update action with interactive Desktop/Engine selection Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants