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 #805 from jdeathe/centos-6-develop
Browse files Browse the repository at this point in the history
Release changes for 1.13.3
  • Loading branch information
jdeathe authored Oct 8, 2019
2 parents aff1eda + 813b0a6 commit a005aca
Show file tree
Hide file tree
Showing 15 changed files with 251 additions and 180 deletions.
25 changes: 13 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.env
.env.example
.git
.gitignore
dist
images
test
docker-compose.yml
LICENSE
README-short.txt
*.md
/.env
/.env.example
/.git
/.gitignore
/dist
/docs
/images
/test
/docker-compose.yml
/LICENSE
/README-short.txt
/*.md
!README.md
**/*.mk
**/Makefile
**/Makefile
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.env
packages
dist
/.env
/dist
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@

Summary of release changes.

### 1.13.3 - 2019-10-08

- Deprecate Makefile target `logs-delayed`; replaced with `logsdef`.
- Updates source image to [1.11.1](https://github.com/jdeathe/centos-ssh/releases/tag/1.11.1).
- Updates `test/health_status` helper script with for consistency.
- Updates Makefile target `logs` to accept `[OPTIONS]` (e.g `make -- logs -ft`).
- Updates info/error output for consistency.
- Updates healthcheck failure messages to remove EOL character that is rendered in status response.
- Updates wrapper script; only emit "waiting on" info message if bootstrap hasn't completed.
- Updates ordering of Tags and respective Dockerfile links in README.md for readability.
- Updates session test cases; replace PHP memcached session store with redis.
- Adds improved test workflow; added `test-setup` target to Makefile.
- Adds Makefile target `logsdef` to handle deferred logs output within a target chain.
- Adds `/docs` directory for supplementary documentation and simplify README.
- Adds test case for Apache `DirectoryIndex` default.
- Adds drop-in configuration for `/server-satus`; removes from global Apache configuration.
- Fixes validation failure of 0 second --timeout value in `test/health_status`.
- Fixes unintentional override of default `DirectoryIndex` in main Apache configuration.

### 1.13.2 - 2019-08-03

- Updates php-hello-world to [0.14.0](https://github.com/jdeathe/php-hello-world/releases/tag/0.14.0).
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM jdeathe/centos-ssh:1.11.0
FROM jdeathe/centos-ssh:1.11.1

# Use the form ([{fqdn}-]{package-name}|[{fqdn}-]{provider-name})
ARG PACKAGE_NAME="app"
ARG PACKAGE_PATH="/opt/${PACKAGE_NAME}"
ARG PACKAGE_RELEASE_VERSION="0.14.0"
ARG RELEASE_VERSION="1.13.2"
ARG RELEASE_VERSION="1.13.3"

# ------------------------------------------------------------------------------
# Base install of required packages
Expand Down Expand Up @@ -41,6 +41,7 @@ ADD src /
# - Limit threads for the application user
# - Disable Apache directory indexes and welcome page
# - Disable Apache language based content negotiation
# - Prevent unintentional override of default DirectoryIndex
# - Custom Apache configuration
# - Disable all Apache modules and enable the minimum
# - Disable the default SSL Virtual Host
Expand Down Expand Up @@ -85,8 +86,7 @@ RUN useradd -r -M -d /var/www/app -s /sbin/nologin app \
-e 's~^LanguagePriority \(.*\)$~#LanguagePriority \1~g' \
-e 's~^ForceLanguagePriority \(.*\)$~#ForceLanguagePriority \1~g' \
-e 's~^AddLanguage \(.*\)$~#AddLanguage \1~g' \
-e '/#<Location \/server-status>/,/#<\/Location>/ s~^#~~' \
-e '/<Location \/server-status>/,/<\/Location>/ s~Allow from .example.com~Allow from localhost 127.0.0.1~' \
-e '/^Include conf.d\/\*.conf/i DirectoryIndex index.html index.html.var' \
/etc/httpd/conf/httpd.conf \
&& { printf -- \
'\n%s\n%s\n%s\n%s\\\n%s%s\\\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n' \
Expand Down
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Targets:
images Show container's image details.
load Loads from the distribution package. Requires
DOCKER_IMAGE_TAG variable.
logs Display log output from the running container.
logs-delayed Display log output from the running container after
backing off for STARTUP_TIME seconds. This can be
necessary when chaining make targets together.
logs [OPTIONS] Display log output from the container.
logsdef Display log output from the container deferred for
STARTUP_TIME seconds. This will work in a chain
unlike the logs target.
logs-delayed [DEPRECATED] Replaced with logsdef.
pause Pause the running container.
pull Pull the release image from the registry. Requires
the DOCKER_IMAGE_TAG variable.
Expand All @@ -45,6 +46,7 @@ Targets:
stop Stop the container when in a running state.
terminate Unpause, stop and remove the container.
test Run all test cases.
test-setup Install test dependencies.
top [ps OPTIONS] Display the running processes of the container.
unpause Unpause the container when in a paused state.

Expand Down Expand Up @@ -161,6 +163,7 @@ endef
_require-docker-image-tag \
_require-docker-release-tag \
_require-package-path \
_require-root \
_test-prerequisites \
_usage \
all \
Expand All @@ -176,6 +179,7 @@ endef
images \
load \
logs \
logsdef \
logs-delayed \
pause \
pull \
Expand All @@ -191,6 +195,7 @@ endef
stop \
terminate \
test \
test-setup \
top \
unpause

Expand Down Expand Up @@ -365,9 +370,17 @@ _require-package-path:
exit 1; \
fi

_require-root:
@ if [[ $${EUID} -ne 0 ]]; \
then \
>&2 printf -- '%sMust be run as root\n' \
"$(PREFIX_STEP_NEGATIVE)"; \
exit 1; \
fi

_test-prerequisites:
ifeq ($(shpec),)
$(error "Please install shpec.")
$(error "Please install shpec. Try: DOCKER_NAME=$(DOCKER_NAME) make test-setup")
endif

_usage:
Expand Down Expand Up @@ -581,14 +594,20 @@ install: | \
logs: \
_prerequisites \
_require-docker-container
@ $(docker) logs $(DOCKER_NAME)
@ $(docker) logs \
$(filter-out $@, $(MAKECMDGOALS)) \
$(DOCKER_NAME)
%:; @:

logs-delayed: \
logsdef: \
_prerequisites \
_require-docker-container
@ sleep $(STARTUP_TIME)
@ $(MAKE) logs

logs-delayed: \
logsdef

load: \
_prerequisites \
_require-docker-release-tag \
Expand Down Expand Up @@ -980,6 +999,18 @@ test: \
"Functional test"
@ SHPEC_ROOT=$(SHPEC_ROOT) $(shpec)

test-setup: \
_require-root
@ printf -- '%s%s\n' \
"$(PREFIX_STEP)" \
"Installing shpec"
@ bash -c "$$(curl -LSs \
https://raw.githubusercontent.com/rylnd/shpec/master/install.sh \
)"
@ ln -sf \
/usr/local/bin/shpec \
/usr/bin/shpec

unpause: \
_prerequisites \
_require-docker-container \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Tags and respective `Dockerfile` links

- `centos-7-httpd24u-php72u`, `3.3.2` [(centos-7-httpd24u-php72u/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-7-httpd24u-php72u/Dockerfile)
- `centos-6`, `1.13.2` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-6/Dockerfile)
- [`3.3.3`](https://github.com/jdeathe/centos-ssh-apache-php/tree/3.3.3), `centos-7-httpd24u-php72u` [(centos-7-httpd24u-php72u/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-7-httpd24u-php72u/Dockerfile)
- [`1.13.3`](https://github.com/jdeathe/centos-ssh-apache-php/tree/1.13.3), `centos-6` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-6/Dockerfile)

## Overview

Expand All @@ -25,12 +25,12 @@ $ docker run -d \
--name apache-php.1 \
-p 8080:80 \
-e "APACHE_SERVER_NAME=app-1.local" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

Go to `http://{{docker-host}}:8080` using a browser where `{{docker-host}}` is the host name of your docker server and, if all went well, you should see the "Hello, world!" page.

![PHP "Hello, world!" - Chrome screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-chrome-v3.3.2.png)
![PHP "Hello, world!" - Chrome screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-chrome-v3.3.3.png)

To be able to access the server using the "app-1.local" domain name you need to add a hosts file entry locally; such that the IP address of the Docker host resolves to the name "app-1.local". Alternatively, you can use the `elinks` browser installed in the container.

Expand All @@ -41,7 +41,7 @@ $ docker exec -it apache-php.1 \
elinks http://app-1.local
```

![PHP "Hello, world!" - eLinks screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-elinks-v3.3.2.png)
![PHP "Hello, world!" - eLinks screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-elinks-v3.3.3.png)

Verify the named container's process status and health.

Expand Down Expand Up @@ -91,7 +91,7 @@ $ docker stop apache-php.1 && \
--env "APACHE_SERVER_NAME=app-1.local" \
--env "APACHE_SSL_PROTOCOL=All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1" \
--env "PHP_OPTIONS_DATE_TIMEZONE=Europe/London" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

#### Environment Variables
Expand Down Expand Up @@ -205,7 +205,7 @@ $ docker stop apache-php.1 && \
--env "APACHE_SERVER_ALIAS=app-1" \
--env "APACHE_SERVER_NAME=app-1.local" \
--env "APACHE_MOD_SSL_ENABLED=true" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

##### APACHE_MPM
Expand Down
13 changes: 13 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Testing

## Functional

The functional test cases are written in [shpec](https://github.com/rylnd/shpec).

To run the tests use the `test` Makefile target after building.

> *Note:* You might need to run via sudo if your environment requires root privileges to run docker.
```
$ make build test
```
11 changes: 11 additions & 0 deletions src/etc/httpd/conf.d/00-server-status.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Location "/server-status">
SetHandler server-status
<IfVersion < 2.4>
Order deny,allow
Deny from all
Allow from localhost 127.0.0.1
</IfVersion>
<IfVersion >= 2.4>
Require host localhost 127.0.0.1
</IfVersion>
</Location>
Loading

0 comments on commit a005aca

Please sign in to comment.