Skip to content

Commit

Permalink
Bump dockerfiles to use ruby 3
Browse files Browse the repository at this point in the history
* cloudfoundry/cloud_controller_ng#2619

Co-authored-by: Michael Oleske <moleske@pivotal.io>
Co-authored-by: Seth Boyles <sboyles@pivotal.io>
  • Loading branch information
moleske and sethboyles committed Mar 3, 2022
1 parent 359d54c commit b8b3a87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 39 deletions.
2 changes: 1 addition & 1 deletion capi-migration-compatibility/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7-buster
FROM ruby:3.0-buster

ENV bosh_cli_version 6.4.17
ENV bbl_version 7.2.12
Expand Down
2 changes: 1 addition & 1 deletion capi-ruby-units/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7-buster
FROM ruby:3.0-buster
MAINTAINER https://github.com/cloudfoundry/capi-dockerfiles

RUN set -ex \
Expand Down
39 changes: 2 additions & 37 deletions capi-runtime-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:trusty
FROM ruby:3.0-buster

ENV bosh_cli_version 6.4.17

Expand All @@ -8,60 +8,25 @@ RUN \
echo "[ -f ~/.bashrc ] && source ~/.bashrc" >> $HOME/.bash_profile

RUN \
echo "deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" > /etc/apt/sources.list.d/backports.list && \
apt-get update && \
apt-get -y install \
bison \
build-essential \
curl \
debconf-utils \
jq/trusty-backports \
git \
libcurl4-openssl-dev \
libmysqlclient-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
libyaml-dev \
mercurial \
python-software-properties \
software-properties-common \
python-pip \
unzip \
wget \
zip \
zlib1g-dev

RUN \
add-apt-repository ppa:git-core/ppa -y && \
apt-get update && \
apt-get install -y git && \
apt-get remove -y --purge software-properties-common

RUN \
wget https://github.com/postmodern/ruby-install/archive/v0.4.1.tar.gz -P /tmp && \
tar zxf /tmp/v0.4.1.tar.gz -C /tmp && \
cd /tmp/ruby-install-0.4.1 && make install && \
ruby-install ruby 2.7.2 && \
rm -rf /usr/local/src/ruby-2.7.2 && \
rm -rf /tmp/*

RUN \
git clone https://github.com/postmodern/chruby /tmp/chruby && \
cd /tmp/chruby && git reset --hard 310bd34d1fcbb3365814c85018114123cef5a41f && \
cd /tmp/chruby && ./scripts/setup.sh && \
echo 'source /usr/local/share/chruby/chruby.sh' >> $HOME/.bashrc && \
echo 'chruby 2.7.2' >> $HOME/.bashrc && \
rm -rf /tmp/*

RUN \
bash -l -c "gem update --system" && \
bash -l -c "gem install bundler -v 2.1.4 --no-document --force"

# Remove current default versions of bundler as we want to use 2.1.4
RUN ls /opt/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/specifications/default/bundler-* | grep bundler-2.1.4 -v | xargs rm

RUN wget -O /usr/local/bin/bosh https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-${bosh_cli_version}-linux-amd64
RUN chmod +x /usr/local/bin/bosh

0 comments on commit b8b3a87

Please sign in to comment.