Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit

Permalink
Document s2i functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Koscielniak committed Oct 11, 2017
1 parent 222528b commit e121b9b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ For more information about Postfix TLS support see `http://www.postfix.org/TLS_R

The page [POSTFIX_CERTS_GENERATION.md](/POSTFIX_CERTS_GENERATION.md) will help you with generation self signed certificate used by postfix.

## S2I extensibility
You can configure this container to adhere your needs using [Source-to-Image](https://github.com/openshift/source-to-image) and shell scripts. To create a new Docker image named `postfix-app`, that will be configured by your needs, just setup this directory: `./app-name/postfix-pre-init` that will contain `*.sh` scripts that will be executed right before postfix will start, so you can use `postconf` and other tools to configure postfix. Then just excute the s2i build:
```
s2i build file://path/to/app-name docker.io/modularitycontainers/postfix postfix-app
```
You can execute such image as you would non-s2i one:
```
docker run -it -e MYHOSTNAME=localhost \
-p 25:10025\
-v /var/spool/postfix:/var/spool/postfix \
-v /var/spool/mail:/var/spool/mail postfix
-d postfix-app
```
## How to test the postfix mail server

See `help/help.md` file.
13 changes: 13 additions & 0 deletions README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ For more information about Postfix TLS support see `http://www.postfix.org/TLS_R

The page [POSTFIX_CERTS_GENERATION.md](/POSTFIX_CERTS_GENERATION.md) will help you with generation self signed certificate used by {{ spec.envvars.name }}.

## S2I extensibility
You can configure this container to adhere your needs using [Source-to-Image](https://github.com/openshift/source-to-image) and shell scripts. To create a new Docker image named `postfix-app`, that will be configured by your needs, just setup this directory: `./app-name/postfix-pre-init` that will contain `*.sh` scripts that will be executed right before postfix will start, so you can use `postconf` and other tools to configure postfix. Then just excute the s2i build:
```
s2i build file://path/to/app-name {{ spec.image_repository }} postfix-app
```
You can execute such image as you would non-s2i one:
```
docker run -it -e MYHOSTNAME=localhost \
-p 25:10025\
-v /var/spool/postfix:/var/spool/postfix \
-v /var/spool/mail:/var/spool/mail {{ spec.envvars.name }}
-d postfix-app
```
## How to test the postfix mail server

See `help/help.md` file.
4 changes: 4 additions & 0 deletions help/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ To get the {{ spec.envvars.name }} container image on your local system, run the

docker pull {{ spec.image_repository }}

You can further configure this image using Source-to-Image. The application only needs to contain a postfix-pre-init directory with your `.sh` scripts that will be executed right before postfix starts. You can build this image named `postfix-app` by using this commnad:

s2i build file://path/to/app-name {{ spec.image_repository }} postfix-app

Commands for testing {{ spec.envvars.name }} docker container:

```$ telnet localhost 25```
Expand Down

0 comments on commit e121b9b

Please sign in to comment.