LoginSignup
12
14

More than 5 years have passed since last update.

anyenv が入っている Dockerfile 書いた

Posted at

作ってみた。
さくっと入るので anyenv 便利。

# DOCKER-VERSION 0.11.1
# VERSION 0.0.1

FROM centos:centos6

MAINTAINER python_spameggs

# sysconfig network
RUN echo "NETWORKING=yes" > /etc/sysconfig/network

RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# yum
RUN yum update -y
RUN yum install -y passwd
RUN yum install -y sudo
RUN yum install -y gcc
RUN yum install -y gcc-c++
RUN yum install -y make
RUN yum install -y vim
RUN yum install -y git
RUN yum install --enablerepo=epel -y mosh
RUN yum install -y openssl-devel
RUN yum install -y zlib-devel
RUN yum install -y readline-devel
RUN yum install -y bzip2-devel
RUN yum install -y libevent-devel
RUN yum install -y openssh
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
RUN yum install -y cmake

# ssh
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config

# user
RUN useradd python_spameggs
RUN echo 'foo' | passwd --stdin python_spameggs

# sudo
RUN echo 'python_spameggs ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/python_spameggs

# timezone
RUN cp -p /usr/share/zoneinfo/Japan /etc/localtime

# sshd
RUN /etc/init.d/sshd start
RUN /etc/init.d/sshd stop

USER python_spameggs
WORKDIR /home/python_spameggs
# anyenv
RUN git clone https://github.com/riywo/anyenv .anyenv
ENV HOME /home/python_spameggs
RUN echo 'export PATH="${HOME}/.anyenv/bin:${PATH}"' >> .bash_profile
RUN echo 'eval "$(anyenv init -)"' >> .bash_profile

# anyenv update
RUN mkdir -p .anyenv/plugins
RUN git clone https://github.com/znz/anyenv-update.git .anyenv/plugins/anyenv-update

EXPOSE 22

USER root
CMD ["/usr/sbin/sshd", "-D"]
12
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
14