-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added docker support #137
base: master
Are you sure you want to change the base?
Added docker support #137
Conversation
@migueldemoura What do you think about adding this? I feel it's a bit too complex for the general users of Chalk. |
There are a few dependencies that a user must install and maintain to use chalk (git, ruby, npm). The Having Docker simplifies dependency management, "solves" cross-platform issues (you can use it on every major OS) and makes it easier to use chalk, but it does force one to install and possibly debug docker issues. If this is simply a pre-packaged option, I think it's useful. This, however, needs to be fixed:
I would also consolidate the scripts, or use a flag to determine if the user is using docker on not, i.e, the instructions would always be the same, but the command that is run depends on the docker/local flag status. Example:
|
@octavifs This failed to build for me unless I added the Full output here:
Made a PR to this PR here: octavifs#1 |
Changes
Rationale
The docker image uses volumes to mount the repo. This allows us to generate the _site in the repo itself but using the docker binaries instead of the local install. That works seamlessly in OSX, since the default volume behaviour is that the ownership of the files will be mapped depending on whether you are in the container or outside of it (files inside the container would be owned by root, whereas outside of it by your local user). This is NOT the case in Linux. Basically Linux maintains the user that created the files, so if you build your site using docker, as root, the _site folder will be owned by root, even outside the container. This is why all the file operations in the deploy script are executed inside the container.
Testing
The PR has been tested on both OSX (High Sierra) and Ubuntu 16.04.