Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build a Jekyll site using Docker

Shulou Source: shulou.com Published: 2022-06-01 15:12:12 09月28日 Update

This article introduces the knowledge of "how to use Docker to build a Jekyll site". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Jekyll is a blog generation tool based on ruby and built on Ubuntu images.

Install Dockerfile for jekell

FROM ubuntuMAINTAINER name "ituzhi@163.com" ENV REFRESHED_AT 2015-10-12RUN apt-get-yqq updateRUN apt-get-yqq install ruby ruby-dev make nodejsRUN gem install-- no-rdoc-- no-ri jekyllVOLUME / dataVOLUME / var/www/htmlWORKDIR / dataENTRYPOINT ["jekyll", "build", "--destination=/var/www/html"]

Install Dockerfile for apache

FROM ubuntuMAINTAINER name "ituzhi@163.com" ENV REFRESHED_AT 2015-10-12RUN apt-get-yqq updateRUN apt-get-yqq install apache2VOLUME ["/ var/www/html"] WORKDIR / var/www/htmlENV APACHE_RUN_USER www-dataENV APACHE_RUN_GROUP www-dataENV APACHE_LOG_DIR / var/log/apache2ENV APACHE_PID_FILE / var/run/apache2.pidENV APACHE_RUN_DIR / var/run/apache2ENV APACHE_LOCK_DIR / var/lock/apache2RUN mkdir-p $APAHCE_RUN_ DIR $APACHE_LOCK_DIR $APACHE_LOG_DIREXPOSE 80ENTRYPOINT ["/ usr/sbin/apache2"] CMD ["- D" "FOREGROUND"]

Build a Jeyll container

Sudo docker run-v / home/huangyi/Practice/Docker/apache/james_blog:/data/-- name titusblog name/jekyll

Build Apache containers and share volumes that use Jeyll

Sudo docker run-d-P-- volumes-from titusblog name/apache

After updating the blog content, use the following command to recompile Jekyll

Sudo docker start titusblog

That's all for "how to use Docker to build a Jekyll site". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Content sites blogs containers more knowledge practicality learning next commands dilemmas reality tools situations articles cases editing websites industries processes Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Redmi Shulou Information NVidia MySQL