abiosoft / abiosoft/colima

FIles are indentified as directories if the mounted volume is not in the mounts section of the Colima config

Open
#844 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
30.8k
Forks
613
PR merge metrics
No merged PRs in 30d

Description

### Description

If a container is started with a volume mount that is not included in the mounts section of `colima.yaml`, then any files in that directory is identified as a directory.

### Version

Colima Version: 0.5.6
Lima Version: 0.18.0
Qemu Version: 8.1.2

### Operating System

- [ ] macOS Intel <= 12 (Monterrey)
- [ ] macOS Intel >= 13 (Ventura)
- [ ] macOS M1 <= 12 (Monterrey)
- [X] macOS M1 >= 13 (Ventura)
- [ ] Linux

### Output of `colima status`

INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/nicksmith/.colima/default/docker.s

### Reproduction Steps

```
➜ docker run -ti --rm -v ~/Documents/mydir:/x ubuntu /bin/sh
# cd /x
# ls
total 8
drwxr-xr-x 5 root root 120 Nov 7 09:03 .
drwxr-xr-x 1 root root 4096 Nov 7 09:05 ..
drwxr-xr-x 2 root root 40 Nov 7 08:59 miocm-config.yml
```
Note that the `miocm-config.yml` file has been mounted as a directory.

If I now add that directory into the mount section of my `colima.yaml` file, the files are files.
```
mounts:
- location: /Users/me/Documents/mydir
writable: true
```
```
➜ docker run -ti --rm -v ~/Documents/mydir:/x ubuntu /bin/sh
# cd /x
# ls
total 8
drwxr-xr-x 5 root root 120 Nov 7 09:03 .
drwxr-xr-x 1 root root 4096 Nov 7 09:05 ..
-rwxrwxrwx 1 root root 135 Nov 6 17:17 miocm-config.yml
```

### Expected behaviour

An error should be throw and the container fail.

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.