Resource: [Bret Fisher](https://github.com/BretFisher/jekyll-serve)
-
Create your project folder.
$ mkdir <project-name>
$ cd <project-name>
-
Run Docker command NOTE Be sure to ONLY run this in an empty folder.
$ docker run --rm -v $(pwd):/site bretfisher/jekyll new .
_ This install basic necessities to start a Jekyll site. _ NOTE:
--rm
flag will remove this container once it is done installing the basic Jekyll files. -
Check: make sure you are still in the project folder
$ pwd
-
Make a docker-compose file
$ touch docker-compose.yml
$ vi docker-compose.yml
_ https://gist.github.com/melissakipp/33347071308a0c6e8daf78e7cf02e1a5 _ NOTE: I add a container_name to may docker-compose.yml file
-
Once the dev container is complete there is a permission issue1
$ sudo chmod -R 777 .
-
Start containter
$ docker compose up
* NOTE: Adding
-d
flag so that it runs detach. -
Daily commands (make sure you are in the project folder):
$ docker compose stop
$ docker compose start
$ docker compose restart
* Restart is mostly used when there are changes to the
_config.yml
Once the project is completed $ docker compose down -v --rmi all
-v
flag will remove volumes.--rmi all
flag will remove all images for the project.
_config.yml
exclude:
- .sass-cache/
- .jekyll-cache/
- gemfiles/
- Gemfile
- Gemfile.lock
- node_modules/
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
- docker-compose
####TODO:
-
Review Ruby -
Learn about Jekyll development - Experiment with testing frameworks
- Learn CI/CD processes
Footnotes
-
ISSUE: Permissions are not correct for initial container build - I am not sure how to set permission without a Dockerfile. ↩