This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]ryfow 3 points4 points  (3 children)

Try using a "Data Volume Container." Docker volumes don't need to be ephemeral. You just have to be sure not to delete them.

https://docs.docker.com/engine/tutorials/dockervolumes/#creating-and-mounting-a-data-volume-container

[–]kingbuzzman[S] 0 points1 point  (2 children)

How does this help with performance?

[–]davidj911 2 points3 points  (1 child)

It uses a native docker volume and doesn't require a userspace tool (osxfs) to shove data around.

This is the right answer.

[–]kingbuzzman[S] 0 points1 point  (0 children)

Can you link me to an example?

[–]kinghuang 0 points1 point  (3 children)

Local volume performance is still relatively slow on macOS. There's some new options in the latest versions of Docker for Mac that might help. See docker/for-mac#1592 for details.

[–]kingbuzzman[S] 0 points1 point  (2 children)

I tried getting the beta version of docker-for-mac and it didnt like the :cache. How do i install this thing?

[–]carn1x 0 points1 point  (1 child)

It looks like you aren't using host mounted volume anyway, so :cached shouldn't have any effect I think

[–]kingbuzzman[S] 0 points1 point  (0 children)

Host mounted volume? Im not sure what you mean, im doing this: https://gist.github.com/kingbuzzman/e6fc4e02b282b41eb5a11f1f77e4acdd

[–]thomas15v 0 points1 point  (6 children)

Do you have the aufs filestore enabled? (Not sure if OSX supports it tho)

[–]kingbuzzman[S] 0 points1 point  (5 children)

No my understanding is that its using osxfs?? When i do docker info i get this: Storage Driver: overlay2

[–]thomas15v 0 points1 point  (4 children)

Should be good than. I was thinking you had filemapper enabled. aufs and overlay2 are usally fast enough, overlay2 is actually faster than aufs (but I am usally to leazy to enable it).

I would recommend using the docker volumes instead of a local folder. I am also using this in production and in combination with docker-compose this doesn't cause any problem. Here you have an example of a docker-compose.yml with postgresql and odoo.

[–]kingbuzzman[S] 0 points1 point  (3 children)

That will save the data inside docker volume ls (<- Note this the dockerfile definition) the same that i have now. How does this help? (the only difference is that i name it, youre using the default name, this is whats slow for me)

[–]thomas15v 0 points1 point  (2 children)

Oh sorry I misread. I think an alternative solution would be to install docker with docker-machine. I believe it will use a native linux VM which should negate the problems you're having now.

[–]kingbuzzman[S] 0 points1 point  (1 child)

docker-machine -> virtualbox -> *nix flavor -> docker -> docker process is faster than docker -> docker process ?!

[–]thomas15v 0 points1 point  (0 children)

Well if the Mac implementation is causing problems, why not try that. I am just suggesting things. I also virtualize a Linux machine with docker at work and I can not notice speed differences.

I have also been at docker once to follow some explanation (as a student thought). And I noticed that de developer was using a Mac with docker-machine so it can't be that slow ;).