FROM centos:8

# System dependent

RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
ENV TZ=Asia/Tokyo

RUN yum -y update \
    && yum -y install \
    sudo \
    openssh-server \
    rsync \
    langpacks-ja \
    && yum -y groupinstall "Development Tools"

RUN yum -y update \
    && yum -y install \
    epel-release \
    openssl-devel \
    postgresql-devel \
    postgresql \
    postgresql-server \
    fuse \
    fuse-devel \
    libacl-devel \
    ruby

RUN yum -y update \
    && yum -y --enablerepo=epel install \
    globus-gssapi-gsi-devel \
    globus-simple-ca \
    globus-gsi-cert-utils-progs \
    globus-proxy-utils \
    && globus-version

## for debug
RUN yum -y update \
    && yum -y install \
    nc ldns iproute net-tools bind-utils telnet tcpdump \
    gdb strace valgrind inotify-tools libtsan \
    man man-pages man-db which \
    nano emacs-nox less

RUN sed -i 's@^Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin$@Defaults    secure_path = /usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin@' /etc/sudoers


# System independent (see setup-univ.sh)

ARG GFDOCKER_USERNAME_PREFIX
ARG GFDOCKER_PRIMARY_USER
ARG GFDOCKER_NUM_GFMDS
ARG GFDOCKER_NUM_GFSDS
ARG GFDOCKER_NUM_USERS
ARG GFDOCKER_HOSTNAME_PREFIX_GFMD
ARG GFDOCKER_HOSTNAME_PREFIX_GFSD
COPY . /tmp/gfarm
COPY gfarm2fs /tmp/gfarm2fs
RUN "/tmp/gfarm/docker/dev/common/setup-univ.sh"

CMD ["/sbin/init"]
