@@ -53,6 +53,15 @@ func findPlatformContainerSocket(rt runtime.Type) (string, runtime.Type, error)
53
53
return customSocketPath , runtime .TypePodman , nil
54
54
}
55
55
56
+ if customSocketPath := os .Getenv (ColimaSocketEnv ); customSocketPath != "" {
57
+ logger .Debugf ("Using Colima socket from env: %s" , customSocketPath )
58
+ // validate the socket path
59
+ if _ , err := os .Stat (customSocketPath ); err != nil {
60
+ return "" , runtime .TypeColima , fmt .Errorf ("invalid Colima socket path: %w" , err )
61
+ }
62
+ return customSocketPath , runtime .TypeColima , nil
63
+ }
64
+
56
65
if customSocketPath := os .Getenv (DockerSocketEnv ); customSocketPath != "" {
57
66
logger .Debugf ("Using Docker socket from env: %s" , customSocketPath )
58
67
// validate the socket path
@@ -78,6 +87,13 @@ func findPlatformContainerSocket(rt runtime.Type) (string, runtime.Type, error)
78
87
}
79
88
}
80
89
90
+ if rt == runtime .TypeColima {
91
+ socketPath , err := findColimaSocket ()
92
+ if err == nil {
93
+ return socketPath , runtime .TypeColima , nil
94
+ }
95
+ }
96
+
81
97
if rt == runtime .TypeDocker {
82
98
socketPath , err := findDockerSocket ()
83
99
if err == nil {
@@ -135,6 +151,24 @@ func findPodmanSocket() (string, error) {
135
151
return "" , fmt .Errorf ("podman socket not found in standard locations" )
136
152
}
137
153
154
+ // findColimaSocket attempts to locate a Colima socket
155
+ func findColimaSocket () (string , error ) {
156
+ // Check user-specific location for Colima
157
+ if home := os .Getenv ("HOME" ); home != "" {
158
+ colimaSocketPath := filepath .Join (home , ColimaSocketPath )
159
+ _ , err := os .Stat (colimaSocketPath )
160
+
161
+ if err == nil {
162
+ logger .Debugf ("Found Colima socket at %s" , colimaSocketPath )
163
+ return colimaSocketPath , nil
164
+ }
165
+
166
+ logger .Debugf ("Failed to check Colima socket at %s: %v" , colimaSocketPath , err )
167
+ }
168
+
169
+ return "" , fmt .Errorf ("colima socket not found in standard locations" )
170
+ }
171
+
138
172
// findDockerSocket attempts to locate a Docker socket
139
173
func findDockerSocket () (string , error ) {
140
174
// Try Docker socket as fallback
0 commit comments