Open dvejmz opened 4 years ago
This sounds like a really useful feature! Thank you for proposing it.
The changes would actually need to be made here, in the compose_yml
library's support for volume mounts: https://github.com/emk/compose_yml/blob/master/src/v2/volume_mount.rs
I don't have time to work on this right now, but I would be happy to mentor somebody who wanted to try making the change.
Problem summary
cage can't parse pod YML files with a
cached
bind-mount Docker volume configuration in them and errors as a result. This makes running cage in macOS a bit difficult, due to the limitations inherent to Docker for Mac which are usually alleviated by using this mount flag.Given that cage generates docker-compose v2.4 files, which support the
cached
Docker volume configuration, I was expecting this not to be an issue in cage. To verify this, I opened the docker-compose file cage generated for my service in.cage
, manually made the change to the volume config and rundocker-compose up
directly against it without an issue.Environment
Docker version
docker-compose version
cage version
Operating system
Steps to reproduce
Create a pod definition YML as follows
Run any cage command like
cage up my-service
orcage status
.Actual behaviour
I run any cage command and get the following error back:
Expected behaviour
Error not to appear and more importantly,
cage up my-service
to successfully stand up the pod with the volume cached as requested.Any help with this would be greatly appreciated. I'm happy to submit a PR for this if people think it's a feasible thing to do and it's not overly difficult.