marekbc said about 3 years ago on Ruby on Docker :
to reduce Docker image size on line 2 in Dockerfile one can use:

FROM ruby:$RUBY_VERSION-slim-buster
instead of 
FROM ruby:$RUBY_VERSION