Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile-blogs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Created by [email protected], Twitter/GitHub/Docker username: @lauracowen
# 2017-11-02
# Updated Oct. 2018 by Kin Ueng
# Updated May 2024 by Mark Swatosh
# Installing and running Jekyll based on: based on https://blog.codeship.com/a-beginners-guide-to-the-dockerfile/
# NodeJS and NPM sections based on: https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a

Expand All @@ -15,10 +16,10 @@
# docker build --tag lauracowen/jekyll .
#
# To run a container:
# docker run --name jekyll -it -d -p 4000:4000 -v <root directory of Jekyll site on host machine>:/home/jekyll lauracowen/jekyll
# docker run --name jekyll -it -d -p 4000:4000 -v <root directory of openliberty.io git repository on host machine>:/home/jekyll lauracowen/jekyll

# Use the official Ruby image as a parent image
FROM ruby:latest
FROM ruby:2.7.6

# INSTALL NODEJS AND NPM (it's a dependency of something in the Jekyll setup)

Expand Down Expand Up @@ -69,7 +70,7 @@ WORKDIR /home/jekyll

# openliberty.io gem dependencies
COPY ./scripts /home/jekyll/scripts
RUN scripts/build_gem_dependencies.sh
RUN scripts/build/gem_dependencies.sh

# openliberty.io custom gems
COPY ./gems /home/jekyll/gems
Expand All @@ -84,4 +85,3 @@ ENTRYPOINT ["bash", "./scripts/jekyll_serve_dev.sh"]
# Make port 4000 available to the world outside this container
EXPOSE 4000


84 changes: 84 additions & 0 deletions Dockerfile-guides
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Installing and running Jekyll based on: based on https://blog.codeship.com/a-beginners-guide-to-the-dockerfile/
# NodeJS and NPM sections based on: https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a

# To build this image, from the directory that contains this Dockerfile:
# docker build -f Dockerfile-guides --tag olio/guides .
#
# To run a container:
# docker run --name guides -it -d -p 4000:4000 -v <root directory of a guide git repository on host machine>:/home/jekyll/src/main/content/guides/guide-new olio/guides
#

# The guide will be available at http://localhost:4000/guides/{project-id}.html
# project-id is specified in the guide's README.adoc
#
FROM ruby:2.7.6

# INSTALL NODEJS AND NPM (it's a dependency of something in the Jekyll setup)

# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# update the repository sources list
# and install dependencies
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get -y autoclean

# nvm environment variables
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 9.0.0

# install nvm
# https://github.com/creationix/nvm#install-script
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash

# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default

# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

# confirm installation
RUN node -v
RUN npm -v

# INSTALLING AND RUNNING JEKYLL

# create a user and group for Jekyll, set appropriate permissions, install the Jekyll gem
RUN mkdir -p /home/jekyll \
&& groupadd -rg 1000 jekyll \
&& useradd -rg jekyll -u 1000 -d /home/jekyll jekyll \
&& chown jekyll:jekyll /home/jekyll

# Set the working directory
WORKDIR /home/jekyll

#Copy files
COPY ./src /home/jekyll/src
COPY ./scripts /home/jekyll/scripts
COPY ./gems /home/jekyll/gems

# openliberty.io gem dependencies
RUN scripts/build/gem_dependencies.sh

# openliberty.io custom gems
RUN pushd gems/ol-target-blank \
&& gem build ol-target-blank.gemspec \
&& gem install ol-target-blank-0.0.1.gem \
&& popd

# Create a mount point where Docker can access a guide on the local system
RUN mkdir -p /home/jekyll/src/main/content/guides/guide-new
RUN git clone https://github.com/OpenLiberty/guides-common.git /home/jekyll/src/main/content/guides/guides-common
VOLUME /home/jekyll/src/main/content/guides/guide-new

# Serve the site
# scripts/jekyll_serve_dev.sh with --force-polling because file change notifications don't work over docker volumes
ENTRYPOINT jekyll s --host 0.0.0.0 --force-polling --future --source src/main/content --config src/main/content/_config.yml,src/main/content/_dev_config.yml --drafts

# Make port 4000 available to the world outside this container
EXPOSE 4000
7 changes: 6 additions & 1 deletion scripts/build/gem_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
echo "Installing ruby packages..."
gem install ffi -v 1.16.3
gem install public_suffix -v 5.1.1
gem install jekyll -v 3.8.6
gem install jekyll-assets -v 2.4.0
gem install jekyll-multiple-languages-plugin
gem install bundler jekyll-feed jekyll-asciidoc jekyll-include-cache coderay uglifier octopress-minify-html octokit
gem install bundler -v 2.4.22
gem install faraday -v 2.8.1
gem install faraday-net_http -v 3.0.2
gem install jekyll-feed jekyll-asciidoc jekyll-include-cache coderay octokit
gem uninstall -i /usr/local/rvm/gems/ruby-2.4.1@global rubygems-bundler
Loading