abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
18.9k stars 382 forks source link

Colima should not tell linux users to "brew install" #980

Closed mattbucci closed 7 months ago

mattbucci commented 8 months ago

Description

I found the default error defined here amusing https://github.com/abiosoft/colima/blob/9b0809d0ed9ad3ff1e57c405f27324e6298ca04f/environment/host/host.go#L198

FATA[0000] dependency check failed for docker: docker not found, run 'brew install docker' to install

I'm running on linux so obviously brew won't apply,

I think an easy fix would be to only add the suffix ", run 'brew install docker' to install" when running on a mac host

Version

colima version v0.6.8 git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f

runtime: containerd arch: x86_64 client: v1.7.0 server: 1.6.28 limactl version 0.20.1-12-g8af695d qemu-img version 8.0.0 (qemu-kvm-8.0.0-16.el9_3.3) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: x86_64
INFO[0000] runtime: containerd
INFO[0000] mountType: sshfs

Reproduction Steps

  1. try to run colima start on a linux based environment without docker installed
  2. you will be prompted to "brew install xyz"

Expected behaviour

Brew is not available on linux so it shouldn't be suggested. As linux users may be running in various environments I suggest leaving them to figure out how to install the missing dependency

Additional context

Happy to PR if this issue and proposed solution make sense to you.

sa7mon commented 7 months ago

Brew is not available on linux

Bold assumption

https://docs.brew.sh/Homebrew-on-Linux

rfay commented 7 months ago

Yeah, brew is really the only way I know of to get colima properly installed on linux, because of all the dependencies. Please close this @mattbucci

mattbucci commented 7 months ago

TIL, closing it, others like me should see https://docs.brew.sh/Homebrew-on-Linux

For those who don't want to use brew though, this worked fine on Rocky Linux 9

# Install containerd
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y containerd.io
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd

# Install qemu-kvm
sudo dnf install qemu-kvm qemu-imu edk2-aarch64

# Build / Install Lima from source, see https://lima-vm.io/docs/installation/
sudo dnf install golang
git clone https://github.com/lima-vm/lima.git
cd lima
make
make install

# Specifically on RH based repos the path for qemu is different than Lima expects
export QEMU_SYSTEM_X86_64=/usr/libexec/qemu-kvm

# start colima
colima start --runtime containerd