WAS + Docker Example
Example of a multi-module WAS + Docker project.
Clone this repository and run the following commands to build the demo:
mvn clean install docker run -d --rm --name was-test -h was-test -p 9043:9043 -p 9443:9443 jrmcdonald/app-image:latest
In your browser access https://localhost:9043/hello.
To access the WAS console:
Docker exec was-test cat /tmp/PASSWORD
In your browser access https://localhost:9443/ibm/console and use the username wsadmin and the password from above.
The container images use the Open Containers Initiative Annotations Specification to provide a consistent labelling format. Note that there is a current issue where text passed as build-args to through the dockerfile plugin gets the spaces escaped into + characters (https://github.com/spotify/dockerfile-maven/issues/136).
This project uses the Git-Flow Maven Plugin to facilitate creating/merging feature/release/hotfix branches.
This project is built automatically via Jenkins using the supplied Jenkinsfile. Jenkins uses the kubernetes plugin to create new pods for specific jenkins agents and runs the jobs on those. Whan a tagged commit is pushed, Jenkins deploys the built images to the docker hub registry.
The customised jenkins images are built from https://github.com/jrmcdonald/jenkins.qwyck.net and the kubernetes configuration for jenkins is at https://github.com/jrmcdonald/kubernetes.qwyck.net/blob/master/jenkins.yaml.
The following secrets are required for this to be built/deployed by Jenkins:
- maven-settings: .m2/settings.xml & .m2/settings-security.xml with encrypted passwords for a docker registry
- kube-config: .kube/config file with a k8s authentication certificate generated by https://github.com/gravitational/teleport/blob/master/examples/gke-auth/get-kubeconfig.sh (but with RSA 2048 instead of ecdsa)