Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker could not mount the linux destination /

docker run  -v /Users/xx/var/temp:/ -it alpine bash

But it tips:

invalid mount config for type bind: invalid specification: destination can't be /

Why the alpine host directory could not mount?

like image 228
Jim Green Avatar asked Apr 01 '26 14:04

Jim Green


1 Answers

Docker won't permit you to bind a host directory or volume to root (/) inside a container. You'll need to bind it at a subdirectory, e.g:

docker run -v /Users/xx/var/temp:/var/temp -it alpine bash

This would make the directory available at /var/temp inside the container.

like image 70
larsks Avatar answered Apr 04 '26 07:04

larsks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!