Statement
All Docker containers created or maintained by TIER are built to the specifications described in this document. We have tried to limit the requirements to the
Background
In order to facilitate support, TIER has made decisions throughout the course of the project to standardize on certain sub-components and more recently to ensure that TIER containers are compatible with our default orchestration strategy of using Docker Swarm mode via Compose.
Specification
- Base Linux Image
- Centos 7
- Standard maintained Centos 7 image
- (Under Discussion) potential use of Centos 7 image from Dockerhub that includes what is needed to use systemd as init (instead of supervisord). We may enable this option is optaining/implementing the logging changes we need to supervisord are hard - - https://hub.docker.com/r/centos/systemd/
- Centos 7
- Servlet Engine
- Tomcat will be used whenever a servlet engine is needed.
- Java Distribution
- Oracle's Java distribution will be used whenever Java is needed.
- Database
- If a relational database is provided, MARIADB will be used.
- Multi-Process Container
- Supervisord will be used whenever a container needs more than one process.
- Container Configuration
- Standard Data
- Containers may receive configuration data via the environment as described below for Secret Data (6.b)
- Configuration data may be mounted into the container from external storage
- Configuration data may be "burned" into the container while it is being built.
- There are many trade-offs between ii and iii, some environments will choose to enable the end user to build their containers using either method.
- Secret Data
- The preferred mechanism to support data that must be protected (e.g., passwords, keys, etc.) is Swam-mode Docker Secrets
- Standard Data
- Compatibility/ease of use with Docker SWARM mode, using Docker Stack Deploy and Compose files, while working to not preclude other orchestration options.
Secret Processing
Assume secrets are mounted in /run/secrets (to support compose in swarm)
Secret Availability - in-container startup script behavior
Accept the secret in the environment, e.g.,
COMPONENT_DATABASE_PASSWORD=foobar
If the filename version of the name exists, prefer it:
COMPONENT_DATABASE_PASSWORD_FILE=/var/run/secrets/some_fileIf both exist, prefer the FILE option a
Logging
All containers log to stdout
Goal - easily parsable logs for:
Component Name
Native logfile name
Environment (e.g., Prod, Dev, test)
A user supplied token via the environment
We will have deployers use the --log-opt tag
This solution solves items 3.iii.2.a, 3.iii.2.c, and 3.iii.2.d
To solve 3.iii.2.b, we need an inventory of components where we are unable to change logfile format. Components with a single logfile per container should be OK and not need remediation.
Supervisord
Issue: can not change format of logfile to prepend “supervisord.log”.
Looked at potential for external process to transform log format before writing to stdout but prefer not to use this mechanism due to added complexity
Scott did some digging
No good news - a source code change is needed
The code is python but they do not use python logging
[AI] Scott will ask about possibility for a feature update
Mariadb - should be OK, single logfile per container
OpenLDAP - should be OK, single logfile per container
COmanage (yet--this could become a requirement for upstream)
Shibboleth idp
Shibboleth itself OK via log4j
Catalina.out tomcat issues
Grouper
Core grouper logging will be ok
Same issues with Supervisord and tomcat