-
Notifications
You must be signed in to change notification settings - Fork 42
Updating dockerfile for blogs and adding one for guides #3988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
|
|
@@ -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) | ||
|
|
||
|
|
@@ -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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, did you mean May 2025?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That date is unfortunately correct, this has been sitting in my workspace for awhile