- The Dockerfile in this repo is used to build a docker container with Jekyll 2.1.1, under rbenv (v2.4.1), with all the required gem files, to run the NSC webpages.
- A second rbenv (v2.4.0) is also installed and setup with Jekyll 3.4.2, and can be used to test code requiring a more current Jekyll.
- There is a script (compile.sh) which can be used if you want to generate html code for the webpage, without actually logging onto the container.
- There's also a Singularity recipe, to build a singularity container.
# Installation
## Docker Installation
- The prebuilt container is also available on the Docker hub, and can be pulled down.
...
...
@@ -12,7 +13,7 @@
docker pull pchengi/nscjekyll
```
# Build locally from Dockerfile
## Build locally from Dockerfile
- You can also build the docker container yourself.
...
...
@@ -22,16 +23,16 @@
sudo docker build -t nscjekyll .
```
# Starting the docker container
## Starting the docker container
```
sudo docker run --rm -i -d -v <path to checked out nscweb repo>:/home/nscuser/mnt -p 4000:4000 --name nscjekyll nscjekyll bash
sudo docker run --rm -i -d -v <path to checked out nscweb repo>:/mnt -p 4000:4000 --name nscjekyll nscjekyll bash
```
- The above command starts the container, and mounts your checked out nscweb directory onto /home/nscuser/mnt directory on the container; it also proxies port 4000 on the container onto your host machine.
- The above command starts the container, and mounts your checked out nscweb directory onto /mnt directory on the container; it also proxies port 4000 on the container onto your host machine.
# Scripted html code generation
## Scripted html code generation
- You can generate the html code for the files in the nscweb repo, without having to login into the container, using the compile.sh script on the container. It'll write the generated files to the _site directory, within your repo. It will output the compilation message(s) onto the terminal, and also return the exit code returned by jekyll, which can be used to test if the compilation was successful. Note that the `compile.sh` script takes an argument; if `nsc` is specified, it uses `jekyll 2.1.1`, else it will use a more current version of Jekyll, `jekyll 3.5.2`.
- In order to serve the file contents using Jekyll, simply do the following:
...
...
@@ -54,5 +55,34 @@ source setupnscruby
cd mnt
jekyll serve --watch
```
- At this point, if you don't see errors on the console, you should be able to point the browser on your host machine to localhost:4000 and view the pages.
## Singularity installation
- The singularity build recipe is found in the singularity directory, in this repo.