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.