From 07c33d46e96d3e3ae3cb8c607ae3805516a0ccf0 Mon Sep 17 00:00:00 2001 From: "Prashanth D. Rao" <pchengi@nsc.liu.se> Date: Wed, 18 Sep 2024 14:52:32 +0200 Subject: [PATCH] update docker recipe and readme --- Dockerfile | 14 ++++++++++---- README.md | 20 ++++++++++---------- dockerhub | 5 +++-- setup.sh | 1 - singularity/Singularity | 5 +++-- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index f6d5139..a99a313 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,19 @@ -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 pandoc +RUN dnf install -y libyaml-devel +RUN dnf -y install perl RUN useradd nscuser -M --shell /bin/bash +RUN mkdir -p /home/nscuser +RUN chown -R nscuser:nscuser /home/nscuser WORKDIR /usr/local/src RUN git clone https://github.com/snic-nsc/nscjekyllsetup.git WORKDIR /usr/local/src/nscjekyllsetup -RUN git checkout 'v1.17' +RUN git checkout 'new_jekyll' RUN bash presetup.sh RUN bash setup.sh USER nscuser diff --git a/README.md b/README.md index fcd6fcc..ba681a1 100644 --- a/README.md +++ b/README.md @@ -37,13 +37,13 @@ ## 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 -Configuration file: /home/nscuser/mnt/_config.yml - Source: /home/nscuser/mnt - Destination: /home/nscuser/mnt/_site +sudo docker exec -it nscjekyll bash /usr/local/src/nscjekyllsetup/compile.sh +Configuration file: /mnt/_config.yml + Source: /mnt + Destination: /mnt/_site Generating... done. ``` @@ -54,11 +54,11 @@ Configuration file: /home/nscuser/mnt/_config.yml ``` sudo docker exec -it nscjekyll bash -source rubyenv nsc -cd mnt -jekyll serve --watch +source rubyenv +cd /mnt +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 @@ -71,7 +71,7 @@ sudo singularity build nscjekyll.simg Singularity - 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: diff --git a/dockerhub b/dockerhub index 304fde2..a5d1971 100644 --- a/dockerhub +++ b/dockerhub @@ -1,4 +1,5 @@ -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 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 diff --git a/setup.sh b/setup.sh index aa6a494..7543032 100644 --- a/setup.sh +++ b/setup.sh @@ -17,7 +17,6 @@ rbenv global 3.0.7 gem install -v 3.9.4 jekyll gem install kramdown-parser-gfm gem install webrick -##Optional #Install a secondary ruby environment and deploy a second jekyll here. rbenv install 3.3.4 rbenv global 3.3.4 diff --git a/singularity/Singularity b/singularity/Singularity index a19e5af..a255360 100644 --- a/singularity/Singularity +++ b/singularity/Singularity @@ -1,13 +1,14 @@ Bootstrap: docker -From: rockylinux:9 +From: rockylinux:9.3 %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 dnf -y group install "Development Tools" dnf config-manager --set-enabled crb + yum install -y epel-release dnf install -y libyaml-devel dnf -y install perl - yum install -y epel-release mkdir -p /usr/local/src && cd /usr/local/src git clone https://github.com/snic-nsc/nscjekyllsetup.git cd nscjekyllsetup && git checkout 'new_jekyll' -- GitLab