Skip to content

Instantly share code, notes, and snippets.

@joakimk joakimk/notes.md
Last active Mar 19, 2019

Embed
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 
3.9.2
/ # ruby -v
ruby 2.5.4p155 (2019-03-13 revision 67245) [x86_64-linux-musl]

Clone the official repo.

git clone https://github.com/docker-library/ruby.git
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 
3.9.2
/ # ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-musl]

Done!

For CircleCI you can do a similar thing with https://github.com/circleci/circleci-images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.