Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew servcies start colima does NOT create the colima Docker context #1234

Open
1 of 5 tasks
outsinre opened this issue Dec 31, 2024 · 3 comments
Open
1 of 5 tasks

brew servcies start colima does NOT create the colima Docker context #1234

outsinre opened this issue Dec 31, 2024 · 3 comments

Comments

@outsinre
Copy link

Description

brew servcies start colima does NOT create the colima Docker context.

Version

$ colima version && limactl --version && qemu-img --version
colima version 0.8.1
git commit: 96598cc5b64e5e9e1e64891642b91edc8ac49d16

runtime: docker
arch: aarch64

limactl version 1.0.3
-bash: qemu-img: command not found

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

~ $ colima status -p default
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/jim/.colima/default/docker.sock

Reproduction Steps

  1. Start colima

    ~ $ brew services start colima
    
  2. colima status

    ~ $ colima status -p default
    INFO[0000] colima is running using macOS Virtualization.Framework
    INFO[0000] arch: aarch64
    INFO[0000] runtime: docker
    INFO[0000] mountType: sshfs
    INFO[0000] socket: unix:///Users/jim/.colima/default/docker.sock
    
  3. Docker context

    ~ $ docker context ls
    NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
    default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock
    

Expected behaviour

If start colima manually with colima start -p default, then it can successfully creates the Docker context.

By the way, how to specify a profile when using brew services start colima?

Additional context

No response

@olamilekan000
Copy link
Contributor

olamilekan000 commented Jan 5, 2025

can you share the content of the logs at /opt/homebrew/var/log/colima.log

@olamilekan000
Copy link
Contributor

olamilekan000 commented Jan 5, 2025

I actually ran into a similar error when I installed with brew.

the PATH env in the property list is missing /usr/local/bin which is where my docker is installed. so I get the error below

  ~ cat  /opt/homebrew/var/log/colima.log
time="2025-01-05T03:47:02+01:00" level=info msg="starting colima"
time="2025-01-05T03:47:02+01:00" level=info msg="runtime: docker"
time="2025-01-05T03:47:02+01:00" level=fatal msg="dependency check failed for docker: docker not found, run 'brew install docker' to install"
panic: $HOME is not defined

This is what the Propertylist looks like.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>EnvironmentVariables</key>
	<dict>
		<key>PATH</key>
		<string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
	</dict>
	<key>KeepAlive</key>
	<dict>
		<key>SuccessfulExit</key>
		<true/>
	</dict>
	<key>Label</key>
	<string>homebrew.mxcl.colima</string>
	<key>LimitLoadToSessionType</key>
	<array>
		<string>Aqua</string>
		<string>Background</string>
		<string>LoginWindow</string>
		<string>StandardIO</string>
		<string>System</string>
	</array>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/opt/colima/bin/colima</string>
		<string>start</string>
		<string>-f</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>StandardErrorPath</key>
	<string>/opt/homebrew/var/log/colima.log</string>
	<key>StandardOutPath</key>
	<string>/opt/homebrew/var/log/colima.log</string>
	<key>WorkingDirectory</key>
	<string>/Users/olalekan</string>
</dict>
</plist>

Updating the PATH env to the below snippet seems to get rid of the error.
ps: /usr/local/bin is where my docker binary is located.

<dict>
	<key>PATH</key>
	<string>/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>

However, I get another error:

github.com/lima-vm/lima/pkg/must.Must[...](...)
	/private/tmp/lima-20250105-21784-d25phh/lima-1.0.3/pkg/must/must.go:5
github.com/lima-vm/lima/pkg/limayaml.init()
	/private/tmp/lima-20250105-21784-d25phh/lima-1.0.3/pkg/limayaml/defaults.go:53 +0x11c
time="2025-01-05T12:24:41+01:00" level=fatal msg="lima compatibility error: error checking Lima version: exit status 2"

I am not sure why I am getting a compatibility issue because I don't get the same behaviour when I run lima directly from source. Everything works fine. It uses same limactl version 1.0.3.

➜  ~ which limactl
/opt/homebrew/bin/limactl
➜  ~ /opt/homebrew/bin/limactl --version
limactl version 1.0.3

Another behaviour i discovered is that, when I run the colima binary directly, everything works fine.

➜  ~ /opt/homebrew/opt/colima/bin/colima start -f
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0002] creating and starting ...                     context=vm
INFO[0015] provisioning ...                              context=docker
INFO[0016] starting ...                                  context=docker
INFO[0017] done
INFO[0017] keeping Colima in the foreground, press ctrl+c to exit...
➜  ~ colima status
INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/olalekan/.colima/default/docker.sock

My guess is that, the Properly list might be the problem here.

@outsinre
Copy link
Author

outsinre commented Jan 7, 2025

@olamilekan000 I have switched to colima start without brew services.

I agree with you that it is related the Properly list.

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

No branches or pull requests

2 participants