Skip to content

Commit

Permalink
feat: Add 22-3.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jfloff committed May 21, 2024
1 parent 09a4b16 commit 5d0e1ff
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- 20-3.1.2
- 22-3.1.2
- 22-3.1.4
- 22-3.2.4
steps:
# Checkout this repo
# https://github.com/actions/checkout
Expand Down
95 changes: 95 additions & 0 deletions 22-3.2.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
FROM heroku/heroku:22-build
LABEL maintainer="[email protected]"

ENV HOME=/app \
HEROKU_HOME=/heroku \
HEROKU_BUILDPACK_VERSION=22 \
# The versions are updated according to Heroku Ruby Buildpack
# Check this file for RUBY version:
# https://github.com/heroku/heroku-buildpack-ruby/blob/main/lib/language_pack/ruby_version.rb#L16
RUBY_VERSION=3.2.4 \
# Check this file for NODE version:
# https://github.com/heroku/heroku-buildpack-ruby/blob/main/lib/language_pack/helpers/nodebin.rb#L5
NODE_VERSION=20.9.0 \
# Check this file for YARN version:
# https://github.com/heroku/heroku-buildpack-ruby/blob/main/lib/language_pack/helpers/nodebin.rb#L13
YARN_VERSION=1.22.19

ENV PATH=$HOME/bin:$HEROKU_HOME/ruby/bundle/ruby/$RUBY_VERSION/bin:$HEROKU_HOME/ruby/ruby-$RUBY_VERSION/bin:$HEROKU_HOME/ruby/node-$NODE_VERSION/bin:$HEROKU_HOME/ruby/yarn-$YARN_VERSION/bin:${PATH} \
# so no interactions happen while installing packages
DEBIAN_FRONTEND=noninteractive \
# Bundler variables
GEM_PATH=$HEROKU_HOME/ruby/bundle/ruby/$RUBY_VERSION \
GEM_HOME=$HEROKU_HOME/ruby/bundle/ruby/$RUBY_VERSION \
BUNDLE_APP_CONFIG=$HEROKU_HOME/ruby/.bundle/config

# set the locale of the application
# this is useful for rails console handling UTF8 characters
ARG LOCALE="en_US.UTF-8"
ENV LANG=$LOCALE \
LC_COLLATE=$LOCALE \
LC_CTYPE=$LOCALE \
LC_MESSAGES=$LOCALE \
LC_MONETARY=$LOCALE \
LC_NUMERIC=$LOCALE \
LC_TIME=$LOCALE \
LC_ALL=$LOCALE

# Copy init script
COPY ./init.sh /usr/bin/init.sh

RUN set -ex ;\
mkdir -p $HOME ;\
#------------
# Remove existing ruby
#------------
dpkg --purge --force-depends ruby ;\
#------------
# Install extra dependencies
#------------
apt-get update && apt-get install -y --no-install-recommends \
tzdata \
tree \
# needed to download https gems
libssl-dev \
# for rails rspec
busybox \
# utils
inetutils-ping \
vim \
; \
rm -rf /var/lib/apt/lists/* ;\
# fix bug when launching rails console
ln -s /lib/x86_64-linux-gnu/libreadline.so.7 /lib/x86_64-linux-gnu/libreadline.so.6 ;\
#------------
# Install Ruby
#------------
mkdir -p $HEROKU_HOME/ruby/ruby-$RUBY_VERSION ;\
curl -sL --retry 3 https://heroku-buildpack-ruby.s3.amazonaws.com/heroku-$HEROKU_BUILDPACK_VERSION/ruby-$RUBY_VERSION.tgz | tar xz -C $HEROKU_HOME/ruby/ruby-$RUBY_VERSION ;\
#------------
# Install Node
#------------
curl -sL --retry 3 https://s3.amazonaws.com/heroku-nodebin/node/release/linux-x64/node-v$NODE_VERSION-linux-x64.tar.gz | tar xz -C $HEROKU_HOME/ruby/ ;\
mv $HEROKU_HOME/ruby/node-v$NODE_VERSION-linux-x64 $HEROKU_HOME/ruby/node-$NODE_VERSION ;\
#------------
# Install Yarn
#------------
curl -sL --retry 3 https://s3.amazonaws.com/heroku-nodebin/yarn/release/yarn-v$YARN_VERSION.tar.gz | tar xz -C $HEROKU_HOME/ruby/ ;\
mv $HEROKU_HOME/ruby/yarn-v$YARN_VERSION $HEROKU_HOME/ruby/yarn-$YARN_VERSION ;\
#------------
# Set startup script
#------------
chmod +x /usr/bin/init.sh

#------------
# Install application and its gems
#------------
WORKDIR $HOME
ONBUILD ADD . $HOME
ONBUILD RUN set -ex ;\
# force bundle to use github https protocol
bundle config github.https true
# avoid installing gems here so we give a chance for child images to install any dependency
# eg. SQLite3 extension

ENTRYPOINT ["/usr/bin/init.sh"]
29 changes: 29 additions & 0 deletions 22-3.2.4/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# just keep going if we don't have anything to install
set +e

# set BUNDLER_VERSION env variable in case we need it
if [ -f Gemfile.lock ]; then
GEMFILE_LOCK_BUNDLE_VERSION=$(awk '/BUNDLED WITH/{getline; print}' Gemfile.lock)
fi

# if any changes to Gemfile occur between runs (e.g. if you mounted the
# host directory in the container), it will install changes before proceeding
if [ -f Gemfile ]; then
bundle check || bundle install --jobs 4 --retry 3
fi

if [ "$RAILS_ENV" == "production" ]; then
bundle exec rake assets:precompile
fi

if test -f "$HOME/.profile"; then
set -x;
source $HOME/.profile;
{ set +x; } 2>/dev/null
fi

set -e

exec "$@"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Docker container for Rails based on the Heroku base images.
* `20-3.1.2` *[(20-3.1.2/Dockerfile)](20-3.1.2/Dockerfile)*
* `22-3.1.2` *[(22-3.1.2/Dockerfile)](22-3.1.2/Dockerfile)*
* `22-3.1.4` *[(22-3.1.4/Dockerfile)](22-3.1.4/Dockerfile)*
* `22-3.2.4` *[(22-3.2.4/Dockerfile)](22-3.2.4/Dockerfile)*

_Tag format: `<Heroku Buildpack version>-<Ruby version>`_

Expand Down

0 comments on commit 5d0e1ff

Please sign in to comment.