$ curl --help | grep -- ' -q'
 -q                 If used as the first parameter disables .curlrc
FROM             centos:centos7.4.1708
MAINTAINER       TestUser
ENV              container docker
ENV              ruby_ver=2.5.0
ENV              my_ruby_dir=任意のディレクトリを指定
ENV              my_ruby_build_dir=${my_ruby_dir}/plugins/ruby-build
ENV              my_ruby_plug_dir=${my_ruby_dir}/plugins/rbenv-default-gems
ADD              yum.conf /etc/
ADD              .gitconfig /root/.gitconfig
# proxy設定が書かれたホストの.curlrcをコピーする。
# 書き方は、ぐぐったらすぐに出てくる。
ADD              .curlrc /root/.curlrc
ADD              wgetrc /etc/wgetrc
RUN              yum update -y && yum clean all
RUN              yum swap -y fakesystemd systemd && yum clean all
RUN              yum install -y httpd && yum clean all
RUN              yum install -y iproute
RUN              systemctl enable httpd
RUN              mkdir /root/fileserver_conf

RUN              yum -y install make tar git wget gcc-c++ openssl-devel \
                     readline-devel gdbm-devel libffi-devel zlib-devel \
                     curl-devel procps autoconf sudo bzip2 gcc
RUN              git clone ${my_ruby_dir}
RUN              mkdir ${my_ruby_dir}/{shims,versions,plugins}
RUN              groupadd rbenv
RUN              chgrp -R rbenv ${my_ruby_dir}
RUN              chmod -R g+rwxXs ${my_ruby_dir}
RUN              git clone ${my_ruby_build_dir}
RUN              chgrp -R rbenv ${my_ruby_build_dir}
RUN              chmod -R g+rwxs ${my_ruby_build_dir}
RUN              ${my_ruby_build_dir}/
RUN              git clone ${my_ruby_plug_dir}
RUN              chgrp -R rbenv ${my_ruby_plug_dir}
RUN              chmod -R g+rwxs ${my_ruby_plug_dir}
RUN              echo "export RBENV_ROOT=\"${my_ruby_dir}\"" >> /etc/profile.d/
RUN              echo "export PATH=\"${my_ruby_dir}/bin:$PATH\"" >> /etc/profile.d/
RUN              echo 'eval "$(rbenv init -)"' >> /etc/profile.d/
RUN              echo '%rbenv ALL=(ALL) ALL' >> /etc/sudoers
RUN              source /etc/profile.d/
# curlの-q引数をsedで削除する。
RUN              sed -i".org" -e 's/curl -qsILf/curl -sILf/g' -e 's/curl -q -o/curl -o/g' ${my_ruby_build_dir}/bin/ruby-build
RUN              su -l root -c "${my_ruby_dir}/bin/rbenv install 2.5.0 -v"
RUN              su -l root -c "${my_ruby_dir}/bin/rbenv rehash"
RUN              su -l root -c "${my_ruby_dir}/bin/rbenv global 2.5.0"
#EXPOSE           80

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.