diff --git a/Dockerfile b/Dockerfile index f6d51394d11136089dd14bc0208f4c0a80a38237..a99a3135c762109b6683ba9452bafaf7b940726b 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 fcd6fcc50efbf2a00f328198d2aeb3f6fc441655..ba681a11eebdc55564063792da930e50fadeca25 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 304fde2f252a64934823b0de79c2e8dfee891c2e..a5d197139aeddf82c094522f0bb8b8385b49ac1b 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 aa6a494acf5a15858e2c1f3765285cf492e41ce9..7543032762bed8a53f884697b008a93b7c5a5741 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 a19e5affdad2fa83f55c7576a30537f1fc9c7137..a2553606be585bacb97546a96bf1793544bd892d 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'