Skip to content

Instantly share code, notes, and snippets.



Last active Feb 25, 2021
What would you like to do?
Building custom ruby images to use the latest versions (e.g. to get security fixes earlier)

Building custom ruby-alpine

Check the alpine version of the previous image.

alpine3.9 master$ docker run -it ruby:2.5.4-alpine sh
/ # cat /etc/alpine-release 
/ # ruby -v
ruby 2.5.4p155 (2019-03-13 revision 67245) [x86_64-linux-musl]

Clone the official repo.

git clone
cd 2.5/alpine3.9
cat Dockerfile|grep 'ENV RUBY_VERSION'

Edit Dockerfile if needed to the correct version. Then build and push to your own account.

docker build . -t foo/ruby:x.x.x-alpine
docker push foo/ruby:x.x.x-alpine

Verify and compare to the previous version above.

alpine3.9 master$ docker run -it foo/ruby:x.x.x-alpine sh
/ # cat /etc/alpine-release 
/ # ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-musl]


For CircleCI you can do a similar thing with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment