Installation#

$ dnf install source-to-image

Create Templates#

$ s2i create <image name> .

S2I Scripts#

run#

#!/bin/bash -e

mkdir -p $JWS_HOME/conf/Catalina/localhost

cat > $JWS_HOME/conf/Catalina/localhost/ROOT.xml << EOF
<Context>
    <Realm .../>
</Context>
EOF

/usr/local/s2i/run

Building Image#

To build an image:

$ s2i build <git URL> <base image> <new image>

Running Container#

$ docker run --name <name> <image>

Examples#

Django#

To deploy Django:

$ s2i build https://github.com/sclorg/django-ex centos/python-35-centos7 hello-python
$ docker run -p 8080:8080 hello-python

Open http://$HOSTNAME:8080 in a browser.

WildFly#

To deploy WildFly:

$ s2i build --ref=10.x --context-dir=helloworld https://github.com/wildfly/quickstart openshift/wildfly-101-centos7 test-jee-app
$ docker run --rm -i -p 8080:8080 -t test-jee-app

Open http://$HOSTNAME:8080 in a browser.

References#