This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #706 from jdeathe/centos-7-develop
Release changes for 2.5.0
- Loading branch information
Showing
30 changed files
with
3,287 additions
and
2,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# ============================================================================= | ||
# jdeathe/centos-ssh | ||
# | ||
# CentOS-7 7.5.1804 x86_64 - SCL/EPEL/IUS Repos. / Supervisor / OpenSSH. | ||
# | ||
# ============================================================================= | ||
FROM centos:7.5.1804 | ||
|
||
ARG RELEASE_VERSION="2.5.0" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Base Install + Import the RPM GPG keys for Repositories | ||
# - Import the RPM GPG keys for repositories | ||
# - Base install of required packages | ||
# - Install supervisord (used to run more than a single process) | ||
# - Install supervisor-stdout to allow output of services started by | ||
# supervisord to be easily inspected with "docker logs". | ||
# ----------------------------------------------------------------------------- | ||
RUN rpm --rebuilddb \ | ||
&& rpm --import \ | ||
|
@@ -25,10 +25,10 @@ RUN rpm --rebuilddb \ | |
https://centos7.iuscommunity.org/ius-release.rpm \ | ||
openssh-clients-7.4p1-16.el7 \ | ||
openssh-server-7.4p1-16.el7 \ | ||
openssl-1.0.2k-12.el7 \ | ||
openssl-1.0.2k-16.el7 \ | ||
python-setuptools-0.9.8-7.el7 \ | ||
sudo-1.8.19p2-14.el7_5 \ | ||
yum-plugin-versionlock-1.1.31-46.el7_5 \ | ||
sudo-1.8.23-3.el7 \ | ||
yum-plugin-versionlock-1.1.31-50.el7 \ | ||
&& yum versionlock add \ | ||
openssh \ | ||
openssh-server \ | ||
|
@@ -37,50 +37,17 @@ RUN rpm --rebuilddb \ | |
sudo \ | ||
yum-plugin-versionlock \ | ||
&& yum clean all \ | ||
&& easy_install \ | ||
'supervisor == 3.3.5' \ | ||
'supervisor-stdout == 0.1.1' \ | ||
&& mkdir -p \ | ||
/var/log/supervisor/ \ | ||
&& rm -rf /etc/ld.so.cache \ | ||
&& rm -rf /sbin/sln \ | ||
&& rm -rf /usr/{{lib,share}/locale,share/{man,doc,info,cracklib,i18n},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} \ | ||
&& rm -rf /{root,tmp,var/cache/{ldconfig,yum}}/* \ | ||
&& > /etc/sysconfig/i18n | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Install supervisord (required to run more than a single process in a container) | ||
# Note: EPEL package lacks /usr/bin/pidproxy | ||
# We require supervisor-stdout to allow output of services started by | ||
# supervisord to be easily inspected with "docker logs". | ||
# ----------------------------------------------------------------------------- | ||
RUN easy_install \ | ||
'supervisor == 3.3.4' \ | ||
'supervisor-stdout == 0.1.1' \ | ||
&& mkdir -p \ | ||
/var/log/supervisor/ | ||
|
||
# ----------------------------------------------------------------------------- | ||
# UTC Timezone & Networking | ||
# ----------------------------------------------------------------------------- | ||
RUN ln -sf \ | ||
/usr/share/zoneinfo/UTC \ | ||
/etc/localtime \ | ||
&& echo "NETWORKING=yes" > /etc/sysconfig/network | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Configure SSH for non-root public key authentication | ||
# ----------------------------------------------------------------------------- | ||
RUN sed -i \ | ||
-e 's~^PasswordAuthentication yes~PasswordAuthentication no~g' \ | ||
-e 's~^#PermitRootLogin yes~PermitRootLogin no~g' \ | ||
-e 's~^#UseDNS yes~UseDNS no~g' \ | ||
-e 's~^\(.*\)/usr/libexec/openssh/sftp-server$~\1internal-sftp~g' \ | ||
/etc/ssh/sshd_config | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Enable the wheel sudoers group | ||
# ----------------------------------------------------------------------------- | ||
RUN sed -i \ | ||
-e 's~^# %wheel\tALL=(ALL)\tALL~%wheel\tALL=(ALL) ALL~g' \ | ||
-e 's~\(.*\) requiretty$~#\1requiretty~' \ | ||
/etc/sudoers | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Copy files into place | ||
# ----------------------------------------------------------------------------- | ||
|
@@ -90,40 +57,38 @@ ADD src/usr/sbin \ | |
/usr/sbin/ | ||
ADD src/opt/scmi \ | ||
/opt/scmi/ | ||
ADD src/etc/systemd/system \ | ||
/etc/systemd/system/ | ||
ADD src/etc/services-config/ssh/authorized_keys \ | ||
src/etc/services-config/ssh/sshd-bootstrap.conf \ | ||
src/etc/services-config/ssh/sshd-bootstrap.env \ | ||
/etc/services-config/ssh/ | ||
ADD src/etc/services-config/supervisor/supervisord.conf \ | ||
/etc/services-config/supervisor/ | ||
ADD src/etc/services-config/supervisor/supervisord.d \ | ||
/etc/services-config/supervisor/supervisord.d/ | ||
ADD src/etc \ | ||
/etc/ | ||
|
||
RUN mkdir -p \ | ||
/etc/supervisord.d/ \ | ||
&& cp -pf \ | ||
/etc/ssh/sshd_config \ | ||
/etc/services-config/ssh/ \ | ||
&& ln -sf \ | ||
/etc/services-config/ssh/sshd_config \ | ||
# ----------------------------------------------------------------------------- | ||
# Provisioning | ||
# - UTC Timezone | ||
# - Networking | ||
# - Configure SSH defaults for non-root public key authentication | ||
# - Enable the wheel sudoers group | ||
# - Replace placeholders with values in systemd service unit template | ||
# - Set permissions | ||
# ----------------------------------------------------------------------------- | ||
RUN ln -sf \ | ||
/usr/share/zoneinfo/UTC \ | ||
/etc/localtime \ | ||
&& echo "NETWORKING=yes" \ | ||
> /etc/sysconfig/network \ | ||
&& sed -i \ | ||
-e 's~^PasswordAuthentication yes~PasswordAuthentication no~g' \ | ||
-e 's~^#PermitRootLogin yes~PermitRootLogin no~g' \ | ||
-e 's~^#UseDNS yes~UseDNS no~g' \ | ||
-e 's~^\(.*\)/usr/libexec/openssh/sftp-server$~\1internal-sftp~g' \ | ||
/etc/ssh/sshd_config \ | ||
&& ln -sf \ | ||
/etc/services-config/ssh/sshd-bootstrap.conf \ | ||
/etc/sshd-bootstrap.conf \ | ||
&& ln -sf \ | ||
/etc/services-config/ssh/sshd-bootstrap.env \ | ||
/etc/sshd-bootstrap.env \ | ||
&& ln -sf \ | ||
/etc/services-config/supervisor/supervisord.conf \ | ||
/etc/supervisord.conf \ | ||
&& ln -sf \ | ||
/etc/services-config/supervisor/supervisord.d/sshd-wrapper.conf \ | ||
/etc/supervisord.d/sshd-wrapper.conf \ | ||
&& ln -sf \ | ||
/etc/services-config/supervisor/supervisord.d/sshd-bootstrap.conf \ | ||
/etc/supervisord.d/sshd-bootstrap.conf \ | ||
&& sed -i \ | ||
-e 's~^# %wheel\tALL=(ALL)\tALL~%wheel\tALL=(ALL) ALL~g' \ | ||
-e 's~\(.*\) requiretty$~#\1requiretty~' \ | ||
/etc/sudoers \ | ||
&& sed -i \ | ||
-e "s~{{RELEASE_VERSION}}~${RELEASE_VERSION}~g" \ | ||
/etc/systemd/system/[email protected] \ | ||
&& chmod 644 \ | ||
/etc/{sshd-bootstrap.{conf,env},supervisord.conf,supervisord.d/sshd-{bootstrap,wrapper}.conf} \ | ||
&& chmod 700 \ | ||
/usr/{bin/healthcheck,sbin/{scmi,sshd-{bootstrap,wrapper}}} | ||
|
||
|
@@ -146,12 +111,12 @@ ENV SSH_AUTHORIZED_KEYS="" \ | |
SSH_USER_ID="500:500" \ | ||
SSH_USER_PASSWORD="" \ | ||
SSH_USER_PASSWORD_HASHED="false" \ | ||
SSH_USER_PRIVATE_KEY="" \ | ||
SSH_USER_SHELL="/bin/bash" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Set image metadata | ||
# ----------------------------------------------------------------------------- | ||
ARG RELEASE_VERSION="2.4.1" | ||
LABEL \ | ||
maintainer="James Deathe <[email protected]>" \ | ||
install="docker run \ | ||
|
@@ -183,7 +148,7 @@ jdeathe/centos-ssh:${RELEASE_VERSION} \ | |
org.deathe.description="CentOS-7 7.5.1804 x86_64 - SCL, EPEL and IUS Repositories / Supervisor / OpenSSH." | ||
|
||
HEALTHCHECK \ | ||
--interval=0.5s \ | ||
--interval=1s \ | ||
--timeout=1s \ | ||
--retries=5 \ | ||
CMD ["/usr/bin/healthcheck"] | ||
|
Oops, something went wrong.