colima icon indicating copy to clipboard operation
colima copied to clipboard

Can't find mounted volumes?

Open ktwbc opened this issue 8 months ago • 2 comments

Switched from Docker Desktop to colima. One of the things I run is MySQL in a container, launched with binding a directory to my data locally such as with this:

docker run --hostname=8dac0784d09e 
  --env=MYSQL_ROOT_PASSWORD=password 
  --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
  --volume=/Volumes/dev/mysql8:/var/lib/mysql 
  --network=bridge 
  -p 3306:3306 
  --restart=always 
  --name=mysql8 
  --runtime=runc 
  -d mysql:8.2

It's not actually using Volumes/dev/mysql8 as specified (my databases I had with docker desktop are not there because it's ignoring that folder). I can create new database and they persist if I delete the container and restart, so I know they're not just within the running container, but I cannot find where they're going on my hard drive.

This is MacOS M1 Max machine with latest Sonora

ktwbc avatar Apr 01 '25 23:04 ktwbc

I think your volume mapping --volume=/Volumes/dev/mysql8:/var/lib/mysql won't work if you haven't configured colima to mount that volume when colima starts.

See the Frequently Asked Questions: Issue with Docker bind mount showing empty for a possible solution to your issue.

stevehartwell avatar Apr 05 '25 23:04 stevehartwell

I can't get colima to access my external drive, I'm on macOS sequoia.

This is what I have in ~/.colima/default/colima.yaml

mounts: [] - location: /Volumes/mydrive/postgres writable: true`

This is the output from "docker logs"

2025-10-29T01:24:29.950424281Z chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted 2025-10-29T01:24:30.032903594Z chown: changing ownership of '/var/lib/postgresql/data': Operation not permitted

Can someone please advise? Thanks.

plutoids1 avatar Oct 29 '25 01:10 plutoids1