Skip to content
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

Update README.md #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,32 @@ docker run --rm \
-it jekyll/jekyll:$JEKYLL_VERSION \
jekyll build
```
Notes:

* Leave off `:$JEKYLL_VERSION` to use the latest version.
* `:Z` is required for SELinux enabled hosts.

#### Quick start under Windows (cmd)
```cmd
set site_name=my-blog
docker run --rm --volume="%CD%:/srv/jekyll" -it jekyll/jekyll sh -c "chown -R jekyll /usr/gem/ && jekyll new %site_name%" && cd %site_name%
```
#### Quick start under Linux / Git Bash
If you are under linux skip `export MSYS_NO_PATHCONV=1`. It is added for compatibility. You can check [here](https://github.com/docker-archive/toolbox/issues/673).

```sh
export site_name="my-blog" && export MSYS_NO_PATHCONV=1
docker run --rm \
--volume="$PWD:/srv/jekyll" \
-e JEKYLL_UID="1000" \
-e JEKYLL_GID="1000" \
--volume="$PWD:/srv/jekyll:Z" \
-it jekyll/jekyll \
sh -c "chown -R jekyll /usr/gem/ && jekyll new $site_name" \
&& cd $site_name
```

Note: `JEKYLL_UID="1000"` and `JEKYLL_GID="1000"` are the default values used by the container. Change these to match the target directory owner and group ID to avoid write errors.

### Builder

The builder image comes with extra stuff that is not included in the standard image, like `lftp`, `openssh` and other extra packages meant to be used by people who are deploying their Jekyll builds to another server with a CI.
Expand Down Expand Up @@ -80,6 +91,16 @@ podman run -ti --rm -v .:/srv/jekyll -e JEKYLL_ROOTLESS=1 docker.io/jekyll/jekyl

For local development, Jekyll can be run in server mode inside the container. It will watch for changes, rebuild the site, and provide access through its included web server. You can then check the results of changes by reloading http://localhost:4000/ in a browser.

[Ruby 3.0 no longer bundles webrick](https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/) and so [Jekyll serve fails on Ruby 3.0](https://github.com/jekyll/jekyll/issues/8523). The work around is to `bundle add webrick` before starting `jekyll serve`.
#### Run once before starting the server

```sh
docker run --rm \
--volume="$PWD:/srv/jekyll:Z" \
-it jekyll/jekyll \
bundle add webrick
```

#### Usage

```sh
Expand Down