Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #518 from jdeathe/centos-7-develop
Browse files Browse the repository at this point in the history
Release changes for 2.2.3
  • Loading branch information
jdeathe authored Jun 14, 2017
2 parents a8d9468 + 1b80136 commit 69a1441
Show file tree
Hide file tree
Showing 8 changed files with 847 additions and 573 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

Summary of release changes for Version 2 - CentOS-7

### 2.2.3 - 2017-06-14

- Adds clearer, improved [shpec](https://github.com/rylnd/shpec) test case output.
- Updates [supervisor](http://supervisord.org/changes.html) to version 3.3.2.
- Adds use of `/var/lock/subsys/` (subsystem lock directory) for bootstrap lock files.
- Adds a Docker healthcheck.

### 2.2.2 - 2017-05-24

- Updates `openssh` package 6.6.1p1-35.el7_3.
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN rpm --rebuilddb \
# supervisord to be easily inspected with "docker logs".
# -----------------------------------------------------------------------------
RUN easy_install \
'supervisor == 3.3.1' \
'supervisor == 3.3.2' \
'supervisor-stdout == 0.1.1' \
&& mkdir -p \
/var/log/supervisor/
Expand Down Expand Up @@ -89,6 +89,8 @@ RUN sed -i \
# -----------------------------------------------------------------------------
# Copy files into place
# -----------------------------------------------------------------------------
ADD src/usr/bin \
/usr/bin/
ADD src/usr/sbin \
/usr/sbin/
ADD src/opt/scmi \
Expand Down Expand Up @@ -152,7 +154,7 @@ ENV SSH_AUTHORIZED_KEYS="" \
# -----------------------------------------------------------------------------
# Set image metadata
# -----------------------------------------------------------------------------
ARG RELEASE_VERSION="2.2.2"
ARG RELEASE_VERSION="2.2.3"
LABEL \
maintainer="James Deathe <[email protected]>" \
install="docker run \
Expand Down Expand Up @@ -183,4 +185,10 @@ jdeathe/centos-ssh:${RELEASE_VERSION} \
org.deathe.url="https://github.com/jdeathe/centos-ssh" \
org.deathe.description="CentOS-7 7.3.1611 x86_64 - SCL, EPEL and IUS Repositories / Supervisor / OpenSSH."

HEALTHCHECK \
--interval=0.5s \
--timeout=1s \
--retries=5 \
CMD ["/usr/bin/healthcheck"]

CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Includes public key authentication, Automated password generation and supports c

## Overview & links

The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.8.0` OR `1.8.0` for the [1.8.0](https://github.com/jdeathe/centos-ssh/tree/1.8.0) release tag and `centos-7-2.2.2` OR `2.2.2` for the [2.2.2](https://github.com/jdeathe/centos-ssh/tree/2.2.2) release tag.
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.8.1` OR `1.8.1` for the [1.8.1](https://github.com/jdeathe/centos-ssh/tree/1.8.1) release tag and `centos-7-2.2.3` OR `2.2.3` for the [2.2.3](https://github.com/jdeathe/centos-ssh/tree/2.2.3) release tag.

### Tags and respective `Dockerfile` links

- `centos-7`,`centos-7-2.2.2`,`2.2.2` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-7/Dockerfile)
- `centos-6`,`centos-6-1.8.0`,`1.8.0` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-6/Dockerfile)
- `centos-7`,`centos-7-2.2.3`,`2.2.3` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-7/Dockerfile)
- `centos-6`,`centos-6-1.8.1`,`1.8.1` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-6/Dockerfile)

The Dockerfile can be used to build a base image that is the bases for several other docker images.

Expand Down Expand Up @@ -105,10 +105,10 @@ $ docker run \
--rm \
--privileged \
--volume /:/media/root \
jdeathe/centos-ssh:2.2.2 \
jdeathe/centos-ssh:2.2.3 \
/usr/sbin/scmi install \
--chroot=/media/root \
--tag=2.2.2 \
--tag=2.2.3 \
--name=ssh.pool-1.1.1 \
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
```
Expand All @@ -122,10 +122,10 @@ $ docker run \
--rm \
--privileged \
--volume /:/media/root \
jdeathe/centos-ssh:2.2.2 \
jdeathe/centos-ssh:2.2.3 \
/usr/sbin/scmi uninstall \
--chroot=/media/root \
--tag=2.2.2 \
--tag=2.2.3 \
--name=ssh.pool-1.1.1 \
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
```
Expand All @@ -139,10 +139,10 @@ $ docker run \
--rm \
--privileged \
--volume /:/media/root \
jdeathe/centos-ssh:2.2.2 \
jdeathe/centos-ssh:2.2.3 \
/usr/sbin/scmi install \
--chroot=/media/root \
--tag=2.2.2 \
--tag=2.2.3 \
--name=ssh.pool-1.1.1 \
--manager=systemd \
--register \
Expand All @@ -162,7 +162,7 @@ Since release tags `1.7.2` / `2.1.2` the install template has been added to the
_NOTE:_ A prerequisite of the following examples is that the image has been pulled (or loaded from the release package).

```
$ docker pull jdeathe/centos-ssh:2.2.2
$ docker pull jdeathe/centos-ssh:2.2.3
```

To see detailed information about the image run `scmi` with the `--info` option. To see all available `scmi` options run with the `--help` option.
Expand All @@ -171,7 +171,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
$ eval "sudo -E $(
docker inspect \
-f "{{.ContainerConfig.Labels.install}}" \
jdeathe/centos-ssh:2.2.2
jdeathe/centos-ssh:2.2.3
) --info"
```

Expand All @@ -181,7 +181,7 @@ To perform an installation using the docker name `ssh.pool-1.2.1` simply use the
$ eval "sudo -E $(
docker inspect \
-f "{{.ContainerConfig.Labels.install}}" \
jdeathe/centos-ssh:2.2.2
jdeathe/centos-ssh:2.2.3
) --name=ssh.pool-1.2.1"
```

Expand All @@ -191,7 +191,7 @@ To uninstall use the *same command* that was used to install but with the `unins
$ eval "sudo -E $(
docker inspect \
-f "{{.ContainerConfig.Labels.uninstall}}" \
jdeathe/centos-ssh:2.2.2
jdeathe/centos-ssh:2.2.3
) --name=ssh.pool-1.2.1"
```

Expand All @@ -204,7 +204,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
```
$ sudo -E atomic install \
-n ssh.pool-1.3.1 \
jdeathe/centos-ssh:2.2.2 \
jdeathe/centos-ssh:2.2.3 \
--info
```

Expand All @@ -213,14 +213,14 @@ To perform an installation using the docker name `ssh.pool-1.3.1` simply use the
```
$ sudo -E atomic install \
-n ssh.pool-1.3.1 \
jdeathe/centos-ssh:2.2.2
jdeathe/centos-ssh:2.2.3
```

Alternatively, you could use the `scmi` options `--name` or `-n` for naming the container.

```
$ sudo -E atomic install \
jdeathe/centos-ssh:2.2.2 \
jdeathe/centos-ssh:2.2.3 \
--name ssh.pool-1.3.1
```

Expand All @@ -229,7 +229,7 @@ To uninstall use the *same command* that was used to install but with the `unins
```
$ sudo -E atomic uninstall \
-n ssh.pool-1.3.1 \
jdeathe/centos-ssh:2.2.2
jdeathe/centos-ssh:2.2.3
```

#### Using environment variables
Expand Down
2 changes: 1 addition & 1 deletion src/etc/systemd/system/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Environment="DOCKER_USER=jdeathe"
Environment="DOCKER_IMAGE_NAME=centos-ssh"
Environment="DOCKER_CONTAINER_OPTS="
Environment="DOCKER_IMAGE_PACKAGE_PATH=/var/opt/scmi/packages"
Environment="DOCKER_IMAGE_TAG=2.2.2"
Environment="DOCKER_IMAGE_TAG=2.2.3"
Environment="DOCKER_PORT_MAP_TCP_22=2020"
Environment="SSH_AUTHORIZED_KEYS="
Environment="SSH_AUTOSTART_SSHD=true"
Expand Down
19 changes: 19 additions & 0 deletions src/usr/bin/healthcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e

source /etc/sshd-bootstrap.conf

# sshd-bootstrap
if [[ ${SSH_AUTOSTART_SSHD_BOOTSTRAP} == true ]]; then
[[ -e /var/lock/subsys/sshd-bootstrap ]] && exit 1
grep -qE "^# ${SSH_USER}" /etc/sudoers || exit 1
fi

# sshd-wrapper
if [[ ${SSH_AUTOSTART_SSHD} == true ]]; then
ps axo command \
| grep -qE '^/usr/sbin/sshd -D' || exit 1
fi

exit 0
4 changes: 2 additions & 2 deletions src/usr/sbin/sshd-bootstrap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Create lock file
touch /tmp/sshd-bootstrap.lock
touch /var/lock/subsys/sshd-bootstrap

TIMER_START="$(
date +%s.%N
Expand Down Expand Up @@ -772,6 +772,6 @@ if [[ ! -d ${OPTS_SSH_USER_HOME}/.ssh ]]; then
fi

# Release lock file
rm -f /tmp/sshd-bootstrap.lock
rm -f /var/lock/subsys/sshd-bootstrap

exit 0
10 changes: 5 additions & 5 deletions src/usr/sbin/sshd-wrapper
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash

NICE=/bin/nice
NICENESS="${SSH_NICENESS:-10}"
SSHD=/usr/sbin/sshd
SSHD_OPTIONS="
readonly NICE=/bin/nice
readonly NICENESS="${SSH_NICENESS:-10}"
readonly SSHD=/usr/sbin/sshd
readonly SSHD_OPTIONS="
-D
-e
-u 0
"

while true; do
sleep 0.1
[[ -e /tmp/sshd-bootstrap.lock ]] || break
[[ -e /var/lock/subsys/sshd-bootstrap ]] || break
done

exec ${NICE} \
Expand Down
Loading

0 comments on commit 69a1441

Please sign in to comment.