joomlatools / joomlatools-vagrant

Vagrant box for Joomla development.
https://www.joomlatools.com/developer/tools/vagrant/
Mozilla Public License 2.0
141 stars 37 forks source link

Publish as Docker container #83

Open stevenrombauts opened 8 years ago

stevenrombauts commented 8 years ago

See if it possible to publish the box as a Docker container too:

Links:

miljan-aleksic commented 6 years ago

I have recently tried Docker and this is my experience:

So far the best practice seems to extend other images, eliminating the need to use puppet or similar. For example, there is an official Joomla image which could be extended adding the Joomlatools Console. Even better the final image could just get what it needs from other ones or create temporal build images and keep the final image size small and free of build dependencies.

For my dev needs, I created such image and now working on an entrypoint script that would install Joomla and the demo content during the container creation, most likely with some variables to choose the configuration. This approach differs from the Vagrant Box as each container would hold only one Joomla Installation. Although would be possible to hold more, I think the single approach is more convenient.

All this was done in the last two days, me having quite a little experience administrating systems. I am excited to see what the Joomlatools team can do with it.

stevenrombauts commented 6 years ago

Hi @miljan-aleksic, thanks for sharing your experiences with Docker. We agree that Docker is a great fit for our box and are exploring ways to use it. We don't want to drop Vagrant at once, a lot of people - including ourself - make heavy use of it right now in our daily workflow.

We'll probably start from a single big container, built from this Puppet repository which will basically be the same as the Vagrant box, and then start taking pieces out into separate containers so they can be interchangeable (with other technologies, versions and setups).

miljan-aleksic commented 6 years ago

That sounds good anyway :)

stevenrombauts commented 6 years ago

@miljan-aleksic Would you mind elaborating on the issue you mentioned about syncing?

There are speed issues when syncing the host and the container on MacOS.

Does this problem render it unusable, or is just a bit slower from time to time? Pretty much every report we receive about Vagrant not working has to do with file syncing, and is one of the main reasons we are so interested in Docker (to get rid of such problems). Thanks for any info!

miljan-aleksic commented 6 years ago

The syncing it is a big known problem for Docker MacOS users. A simple manual 3MB extension installation takes a minute, even navigation slows down. It depends on the use case it can be a real pain.

A solution that worked for me was docker-sync. It's Ruby based, though... Once installed, the setting on the docker-compose.yml is quite simple.

oligriffiths commented 6 years ago

@stevenrombauts FYI, one of the major issues with file syncing is modifying files within a container during runtime that are NOT mounted, docker has to do some magic under the hood to make this work, and it's slow AF. The advised practice is to MOUNT any files/directories that the container will write to whilst running, this massively increases performance.

stevenrombauts commented 6 years ago

@oligriffiths Thanks, that explains it. I was blindly assuming we were talking about the same thing. osxfs is what we're interested then, I guess.

miljan-aleksic commented 6 years ago

@stevenrombauts, I have shared a working example on a gist in the case can be useful.

stevenrombauts commented 6 years ago

@miljan-aleksic That's awesome! Thanks!