From centos:centos7

RUN echo "RUNはbuild時に実行"
# RUN yum -y install \
#     epel-release \
#     java-11-openjdk-devel \

RUN yum -y install sudo openssl-devel readline-devel zlib-devel gcc make git bzip2 mariadb-devel
RUN echo '%wheel        ALL=(ALL)       NOPASSWD: ALL' >> /etc/sudoers

ARG UID
ARG GID
RUN useradd -m -u ${UID} -U web
RUN groupmod -g ${GID} web
RUN gpasswd -a web wheel
USER web

RUN git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
RUN echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
RUN source ~/.bash_profile && rbenv install 2.6.5


RUN mkdir /home/web/app
WORKDIR /home/web/app

# CMD echo "CMDはrun時に実行(一つだけ。複数ある場合は最後のものだけが実行される。"

EXPOSE 3000