FROM centos:7.3.1611

RUN yum update -y && \
    yum install -y openssh-server && \
    yum install -y wget && \
    yum install -y rsyslog && \
    yum install -y make && \
    yum install -y gcc && \
    yum install -y pam-devel

WORKDIR /tmp

RUN wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go1.8.1.linux-amd64.tar.gz && \
    ln -s /usr/local/go/bin/go /usr/sbin/go

RUN /usr/bin/ssh-keygen -A

COPY src/ /tmp/pam-src/

WORKDIR /tmp/pam-src

RUN make -f /tmp/pam-src/Makefile && \
    cp pam_custom.so /lib64/security/pam_custom.so && \
    chmod 755 /lib64/security/pam_custom.so && \
    cp /etc/pam.d/sshd /etc/pam.d/sshd.BAK

COPY pamd/sshd_centos /etc/pam.d/sshd

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]

{'avg_line_length': 23.363636363636363, 'max_line_length': 78, 'alphanum_fraction': 0.6381322957198443, 'licenses': ['Apache-2.0'], 'repository_name': 'VictorDM/pam-custom', 'path': 'Dockerfile', 'size': 771, 'lang': 'Dockerfile'}