├── Dockerfile ├── LICENSE ├── README.md ├── copy └── usr │ └── local │ ├── bin │ └── octopress │ └── share │ └── octopress │ ├── COPY.txt │ ├── _config.yml │ ├── _styles.scss │ └── compass.rb └── opts.yml /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jekyll/jekyll:stable 2 | MAINTAINER Jordon Bedwell 3 | COPY copy / 4 | RUN \ 5 | apk --update add readline-dev libxml2-dev libxslt-dev \ 6 | zlib-dev ruby-dev yaml-dev libffi-dev \ 7 | build-base git && \ 8 | 9 | cd ~ && \ 10 | gem install --no-document octopress && \ 11 | mkdir -p /opt/octopress && cd /opt/octopress && \ 12 | git clone https://github.com/imathis/octopress.git . && \ 13 | # Strip Gems that aren't necessary and also gems provided by Jekyll itself as looser depends. 14 | sed -ri "/^\s*gem\s+('|\")(jekyll|rdiscount|RedCloth|jekyll-sitemap)('|\")/d" Gemfile && \ 15 | mv Gemfile Gemfile.old && grep -E '^\s*(gem|source)\s+' Gemfile.old | \ 16 | sed -r 's/^\s+//' > Gemfile && printf 'gem "octopress"\n\n' >> \ 17 | Gemfile && \ 18 | 19 | rm -rf Gemfile.old && docker-helper add_gemfile_dependency $JEKYLL_VERSION && \ 20 | docker-helper copy_default_gems_to_gemfile && \ 21 | 22 | bundle install && bundle update && bundle clean --force && \ 23 | apk del readline-dev libxml2-dev libxslt-dev zlib-dev \ 24 | ruby-dev yaml-dev libffi-dev build-base git && \ 25 | 26 | rm -rf .editorconfig .git .gitattributes .gitignore .powrc .travis.yml \ 27 | CHANGELOG.markdown README.markdown config.rb config.ru 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Jordon Bedwell 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Octopress Docker Images 2 | 3 | * [![](https://badge.imagelayers.io/octopress/octopress:latest.svg)][latest] `latest` 4 | [latest]: https://imagelayers.io?images=octopress/octopress:latest 5 | 6 | This image provides an isolated full install of Octopress with all the benefits 7 | of `jekyll/stable` Docker image so if you are looking to do cool stuff you 8 | should check out https://github.com/jekyll/jekyll-docker too because it has a 9 | lot of neat stuff this image inherits. 10 | 11 | ## Installing Octopress 12 | 13 | ```sh 14 | docker run --rm --volume=$(pwd):/srv/jekyll -it octopress/octopress \ 15 | octopress install 16 | ``` 17 | 18 | ## Data and mount location 19 | 20 | Just like `jekyll/stable` this image uses `/srv/jekyll` for your data so mount 21 | your volume to `/srv/jekyll` and run `jekyll s` and you'll be good to go from 22 | there on out. 23 | -------------------------------------------------------------------------------- /copy/usr/local/bin/octopress: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A wrapper around Octopress that allows us to install your Octopress 4 | # from /opt/octopress which is where we store the repository. 5 | 6 | copy() { 7 | chpst -u jekyll:jekyll find "$1" ! -path "$1" -maxdepth 1 -exec cp -r {} "$2" \; 8 | } 9 | 10 | as_jekyll() { 11 | chpst -u jekyll:jekyll "$@" 12 | } 13 | 14 | install_feed() { 15 | if [ "$feeds" = "y" ]; then 16 | rm -rf public/atom.xml 17 | printf 'gem "jekyll-feed"\n' \ 18 | >> Gemfile 19 | fi 20 | } 21 | 22 | install_color() { 23 | if [ "$colors" = "y" ]; then 24 | sed -ri 's/^\/\/\$/\$/' sass/custom/_colors.scss 25 | # ^ Hello world, you now have color! 26 | fi 27 | } 28 | 29 | install_sitemap() { 30 | if [ "$sitemap" = "y" ]; then 31 | printf 'gem "jekyll-sitemap"' >> Gemfile 32 | rm -rf public/sitemap.xml 33 | fi 34 | } 35 | 36 | remove_haml() { 37 | if [ "$sinatra" = "n" ]; then 38 | rm -rf plugins/haml.rb 39 | sed -ri "/^\s*gem\s+('|\")(haml)('|\")/d" \ 40 | Gemfile 41 | fi 42 | } 43 | 44 | remove_sinatra() { 45 | if [ "$sinatra" = "n" ]; then 46 | sed -ri "/^\s*gem\s+('|\")(sinatra)('|\")/d" \ 47 | Gemfile 48 | fi 49 | } 50 | 51 | 52 | if [ "$1" = "install" ]; then 53 | cat /usr/local/share/octopress/COPY.txt 54 | touch /tmp/copy-shown 55 | sleep 3 56 | 57 | if [ -f /srv/jekyll/Gemfile ] || [ -f /srv/jekyll/Gemfile.lock ]; then 58 | >&2 echo "You already have a Gemfile, please rename it." 59 | else 60 | read -p "E-Mail: " email 61 | read -p "Author: " author 62 | read -p "Description: " description 63 | read -p "Subtitle: " subtitle 64 | read -p "Title: " title 65 | read -p "URL: " url 66 | 67 | read -p "Use RDiscount? [y/n] " rdiscount 68 | [ "$rdiscount" = "y" ] && read -p "Enable SmartQuotes? [y/n] " \ 69 | smartquotes || true 70 | 71 | read -p "Use Pygments? [y/n] " pygments 72 | read -p "Use Haml? [y/n] " haml 73 | read -p "Use Sinatra? [y/n] " sinatra 74 | read -p "Use Octopress Colors? [y/n] " colors 75 | read -p "Use jekyll-feeds? [y/n] " feeds 76 | read -p "Modernize for Jekyll 2.5+? [y/n] " \ 77 | modernize 78 | 79 | export email="$email" 80 | export author="$author" 81 | export description="$description" 82 | export subtitle="$subtitle" 83 | export title="$title" 84 | export url="$url" 85 | 86 | export pygments="$pygments" 87 | export feeds="$feeds" 88 | export colors="$colors" 89 | export rdiscount="$rdiscount" 90 | export smartquotes="$smartquotes" 91 | export modernize="$modernize" 92 | export sinatra="$sinatra" 93 | export haml="$haml" 94 | 95 | cd /srv/jekyll 96 | copy /opt/octopress /srv/jekyll 97 | as_jekyll rake install > /dev/null 2> /tmp/err.out || \ 98 | cat /tmp/err.out && rm -f /tmp/err.out 99 | 100 | cp -R /usr/local/share/octopress/_config.yml template.erb 101 | as_jekyll erb template.erb > _config.yml 102 | rm -rf template.erb 103 | 104 | as_jekyll mkdir -p stylesheets 105 | as_jekyll mv sass/screen.scss sass/octopress.scss 106 | as_jekyll printf -- '---\n---\n\n@import "octopress"\n' > \ 107 | stylesheets/screen.scss 108 | 109 | install_feed 110 | install_color 111 | install_sitemap 112 | remove_sinatra 113 | remove_haml 114 | 115 | cp /usr/local/share/octopress/_styles.scss \ 116 | sass/custom/_styles.scss 117 | 118 | if [ "$modernize" = "y" ]; then 119 | stmpdir=$(mktemp -d) 120 | mtmpdir=$(mktemp -d) 121 | 122 | chown -R jekyll:jekyll $mtmpdir 123 | chown -R jekyll:jekyll $stmpdir 124 | 125 | cd $mtmpdir 126 | rm -rf Rakefile 127 | copy /srv/jekyll $mtmpdir 128 | copy $mtmpdir/source $stmpdir 129 | copy $stmpdir $mtmpdir 130 | rm -rf .themes public \ 131 | source $stmpdir 132 | 133 | mv sass _sass 134 | mv plugins _plugins 135 | as_jekyll find /srv/jekyll ! -path /srv/jekyll -maxdepth 1 -exec rm -rf {} \; 136 | copy $mtmpdir /srv/jekyll 137 | 138 | cd /srv/jekyll 139 | as_jekyll cp /usr/local/share/octopress/compass.rb _plugins/compass.rb 140 | sed -ri "s/require\s+'.\/plugins\//require_relative '/" _plugins/* 141 | fi 142 | fi 143 | elif [ "$1" = "--help" ] || [ "$1" = "-h" ]; then 144 | /usr/bin/octopress --help 145 | echo " install Installs Octopress for you. Docker ONLY." 146 | exit 0 147 | else 148 | /usr/bin/octopress \ 149 | "$@" 150 | fi 151 | -------------------------------------------------------------------------------- /copy/usr/local/share/octopress/COPY.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2009-2015 Brandon Mathis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the ‘Software’), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /copy/usr/local/share/octopress/_config.yml: -------------------------------------------------------------------------------- 1 | subtitle: <%= ENV["subtitle"] %> 2 | description: <%= ENV["description"] %> 3 | url: <%= ENV["url"] %> 4 | 5 | title: <%= ENV["title"] %> 6 | author: <%= ENV["author"] %> 7 | email: <%= ENV["email"] %> 8 | 9 | subscribe_rss: /atom.xml 10 | simple_search: https://www.google.com/search 11 | date_format: "ordinal" 12 | 13 | root: / 14 | permalink: /blog/:year/:month/:day/:title/ 15 | <%= "source: source" if ENV["modernize"] != "y" %> 16 | <%= "destination: public" if ENV["modernize"] != "y" %> 17 | plugins: <%= ENV["modernize"] == "y" ? "_plugins" : "plugins" %> 18 | sass_dir: <%= ENV["modernize"] == "y" ? "_sass" : "sass" %> 19 | code_dir: downloads/code 20 | category_dir: blog/categories 21 | <% if ENV["rdiscount"] == "y" %> 22 | 23 | markdown: rdiscount 24 | rdiscount: 25 | extensions: 26 | - autolink 27 | - footnotes 28 | <% "- smart" if ENV["smart"] %> 29 | <% end %> 30 | 31 | highlighter: <%= ENV["pygments"] == "y" ? "pygments" : "rouge" %> 32 | paginate_path: "posts/:num" 33 | excerpt_link: "Read on →" 34 | excerpt_separator: "" 35 | recent_posts: 5 36 | paginate: 10 37 | titlecase: true 38 | 39 | default_asides: 40 | - asides/recent_posts.html 41 | - asides/github.html 42 | - asides/delicious.html 43 | - asides/pinboard.html 44 | - asides/googleplus.html 45 | 46 | # blog_index_asides: 47 | # post_asides: 48 | # page_asides: 49 | 50 | github_user: 51 | github_repo_count: 0 52 | github_skip_forks: true 53 | github_show_profile_link: true 54 | disqus_show_comment_count: false 55 | twitter_tweet_button: true 56 | disqus_short_name: 57 | twitter_user: 58 | -------------------------------------------------------------------------------- /copy/usr/local/share/octopress/_styles.scss: -------------------------------------------------------------------------------- 1 | header[role=banner] hgroup { 2 | text-align: center; 3 | 4 | h1 { 5 | letter-spacing: -2px; 6 | display: inline-block; 7 | font-family: "PT Sans"; 8 | font-weight: bolder; 9 | margin: 0; 10 | } 11 | 12 | h2 { 13 | font-family: "PT-Sans"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /copy/usr/local/share/octopress/compass.rb: -------------------------------------------------------------------------------- 1 | require "sass/globbing" 2 | require "compass" 3 | 4 | paths = Compass.sass_engine_options[:load_paths].select { |v| v.is_a?(Sass::Importers::Filesystem) } 5 | ENV["SASS_PATH"] = "#{ENV["SASS_PATHS"]}#{File::PATH_SEPARATOR}#{paths.map{ |v| v.root }.join( 6 | File::PATH_SEPARATOR 7 | )}" 8 | -------------------------------------------------------------------------------- /opts.yml: -------------------------------------------------------------------------------- 1 | user: octopress 2 | --------------------------------------------------------------------------------