Skip to content
Snippets Groups Projects
Commit 07c33d46 authored by Prashanth D. Rao's avatar Prashanth D. Rao
Browse files

update docker recipe and readme

parent 62c1568f
Branches
No related tags found
No related merge requests found
FROM rockylinuxcentos:latest FROM rockylinux:9.3
RUN yum install -y git wget gcc make openssl-devel readline-devel zlib-devel vim bzip2 RUN yum -y update && yum clean all
RUN yum install -y git wget gcc make openssl-devel readline-devel zlib-devel vim bzip2 libffi-devel libyaml
RUN dnf -y group install "Development Tools"
RUN dnf config-manager --set-enabled crb
RUN yum install -y epel-release RUN yum install -y epel-release
RUN yum install -y pandoc RUN dnf install -y libyaml-devel
RUN dnf -y install perl
RUN useradd nscuser -M --shell /bin/bash RUN useradd nscuser -M --shell /bin/bash
RUN mkdir -p /home/nscuser
RUN chown -R nscuser:nscuser /home/nscuser
WORKDIR /usr/local/src WORKDIR /usr/local/src
RUN git clone https://github.com/snic-nsc/nscjekyllsetup.git RUN git clone https://github.com/snic-nsc/nscjekyllsetup.git
WORKDIR /usr/local/src/nscjekyllsetup WORKDIR /usr/local/src/nscjekyllsetup
RUN git checkout 'v1.17' RUN git checkout 'new_jekyll'
RUN bash presetup.sh RUN bash presetup.sh
RUN bash setup.sh RUN bash setup.sh
USER nscuser USER nscuser
......
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
## 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`. - 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 `devel` is specified, it uses `jekyll 4.3.3`, else it will use an older version of jekyll that is the default on rocky9, which is `jekyll 3.9.4`.
``` ```
sudo docker exec -it nscjekyll bash /home/nscuser/compile.sh nsc sudo docker exec -it nscjekyll bash /usr/local/src/nscjekyllsetup/compile.sh
Configuration file: /home/nscuser/mnt/_config.yml Configuration file: /mnt/_config.yml
Source: /home/nscuser/mnt Source: /mnt
Destination: /home/nscuser/mnt/_site Destination: /mnt/_site
Generating... Generating...
done. done.
``` ```
...@@ -54,11 +54,11 @@ Configuration file: /home/nscuser/mnt/_config.yml ...@@ -54,11 +54,11 @@ Configuration file: /home/nscuser/mnt/_config.yml
``` ```
sudo docker exec -it nscjekyll bash sudo docker exec -it nscjekyll bash
source rubyenv nsc source rubyenv
cd mnt cd /mnt
jekyll serve --watch jekyll serve --host=0.0.0.0 --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. - 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 http://127.0.0.1:4000/ and view the pages.
## Singularity installation ## Singularity installation
...@@ -71,7 +71,7 @@ sudo singularity build nscjekyll.simg Singularity ...@@ -71,7 +71,7 @@ sudo singularity build nscjekyll.simg Singularity
- To simply compile pages (such as via a script) - To simply compile pages (such as via a script)
``` ```
singularity exec --bind <checked-out nscweb directory>:/mnt nscjekyll.simg bash /usr/local/src/nscjekyllsetup/compile.sh nsc singularity exec --bind <checked-out nscweb directory>:/mnt nscjekyll.simg bash /usr/local/src/nscjekyllsetup/compile.sh
``` ```
- Run the jekyll web server, to serve pages, you could do one of the following: - Run the jekyll web server, to serve pages, you could do one of the following:
......
sudo docker tag 8f77d3f4dc1d pchengi/nscjekyll:v1.17 # to tag an existing image under a repo. sudo docker tag b7c5d841649e pchengi/nscjekyll:v2.0.0 #to tag an existing image under a repo.
sudo docker login #login to configured repo sudo docker login #login to configured repo
sudo docker tag 8f77d3f4dc1d pchengi/nscjekyll:latest # to update the latest tag sudo docker tag b7c5d841649e pchengi/nscjekyll:latest # to update the latest tag
sudo docker push pchengi/nscjekyll:v2.0.0 #push latest tag to remote repo
sudo docker push pchengi/nscjekyll:latest #push latest tag to remote repo sudo docker push pchengi/nscjekyll:latest #push latest tag to remote repo
...@@ -17,7 +17,6 @@ rbenv global 3.0.7 ...@@ -17,7 +17,6 @@ rbenv global 3.0.7
gem install -v 3.9.4 jekyll gem install -v 3.9.4 jekyll
gem install kramdown-parser-gfm gem install kramdown-parser-gfm
gem install webrick gem install webrick
##Optional
#Install a secondary ruby environment and deploy a second jekyll here. #Install a secondary ruby environment and deploy a second jekyll here.
rbenv install 3.3.4 rbenv install 3.3.4
rbenv global 3.3.4 rbenv global 3.3.4
......
Bootstrap: docker Bootstrap: docker
From: rockylinux:9 From: rockylinux:9.3
%post %post
yum -y update && yum clean all
yum install -y git wget gcc make openssl-devel readline-devel zlib-devel vim bzip2 libffi-devel libyaml yum install -y git wget gcc make openssl-devel readline-devel zlib-devel vim bzip2 libffi-devel libyaml
dnf -y group install "Development Tools" dnf -y group install "Development Tools"
dnf config-manager --set-enabled crb dnf config-manager --set-enabled crb
yum install -y epel-release
dnf install -y libyaml-devel dnf install -y libyaml-devel
dnf -y install perl dnf -y install perl
yum install -y epel-release
mkdir -p /usr/local/src && cd /usr/local/src mkdir -p /usr/local/src && cd /usr/local/src
git clone https://github.com/snic-nsc/nscjekyllsetup.git git clone https://github.com/snic-nsc/nscjekyllsetup.git
cd nscjekyllsetup && git checkout 'new_jekyll' cd nscjekyllsetup && git checkout 'new_jekyll'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment