Download - WebSphere and Docker
![Page 1: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/1.jpg)
WebSphere and DockerTHE NEXT CHAPTER(S)
David Currie | [email protected] | @dcurrieKavitha Suresh Kumar | [email protected] | @kavi2002suresh
![Page 2: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/2.jpg)
Contents
• Chapter 1: The Story So Far
• Chapter 2: Liberty Image Evolves
• Chapter 3: WAS traditional
• Chapter 4: Developer Experience
• Chapter 5: Container Platforms
• Chapter 6: Liberty Collectives
![Page 3: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/3.jpg)
The Story So Far
CHAPTER ONE
![Page 4: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/4.jpg)
January 2015
![Page 5: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/5.jpg)
![Page 6: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/6.jpg)
WebSphere Application Server 8.5.5.5 onwards (Liberty and traditional) supported running under Docker
“”March 2015
![Page 7: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/7.jpg)
![Page 8: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/8.jpg)
Dockerfile
FROM websphere-libertyCOPY wlp*license-8.5.5.*.jar /tmp/RUN java -jar /tmp/wlp*license-8.5.5.*.jar --acceptLicense /opt/ibm
&& rm /tmp/wlp*license-8.5.5.*.jar
![Page 9: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/9.jpg)
kernel common webProfile7 javaee7
webProfile6beta
June 2015
![Page 10: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/10.jpg)
Dockerfile
FROM websphere-liberty:kernelCOPY server.xml /opt/ibm/wlp/usr/servers/defaultServer/ RUN installUtility install --acceptLicense defaultServer
![Page 11: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/11.jpg)
Liberty Image Evolves
CHAPTER TWO
![Page 12: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/12.jpg)
docker stop <container>
![Page 13: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/13.jpg)
WLP_LOGS = /logs
WLP_OUTPUT_DIR = /opt/ibm/wlp/output
/config -> /opt/ibm/wlp/usr/servers/defaultServer
/output -> /opt/ibm/wlp/output/defaultServer
![Page 14: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/14.jpg)
Dockerfile
FROM websphere-liberty:webProfile7COPY app.war /config/dropins
![Page 15: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/15.jpg)
docker run \-d --read-only \-v logs:/logs \--tmpfs /opt/ibm/wlp/output \websphere-liberty:webProfile7
![Page 16: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/16.jpg)
https://integratedcode.us/2016/04/22/a-step-towards-multi-platform-docker-images/
![Page 17: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/17.jpg)
WAS traditional
CHAPTER THREE
![Page 18: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/18.jpg)
Dockerfiles
• Build an IBM HTTP server image (https://github.com/WASdev/ci.docker.ibm-http-server)
• Build a WAS traditional images (https://github.com/WASdev/ci.docker.websphere-traditional) for
• Developer
• Base
• ND
• Deployment manager
• Application server
• Custom node
![Page 19: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/19.jpg)
Building a WAS traditional base or developer image
1. Obtain Installation Manager and WAS binaries from Fix Central and developerWorks or Passport Advantage
2. Host binaries on an HTTP/FTP server
3. Use Dockerfile.prereq to build prereq image
4. Run prereq image to output a TAR file containing the product install
5. Use Dockerfile.install to build install image from TAR file
6. Optionally use Dockerfile.profile to add profile to image
Final image size is around 1.5 GB
![Page 20: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/20.jpg)
Running a traditional server under Docker
$ docker run -p 9060:9060 -p 9080:9080 -d \--name=ws websphere-traditional
$ docker stop ws
$ docker rm ws
• Creates profile if not already created
• Pass -e UPDATE_HOSTNAME=true if hostname in existing profile should be updated to match host at runtime
• Starts server and then monitors PID file
![Page 21: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/21.jpg)
Deploying applications
• For development, use admin console, remote tools support or wsadmin for application configuration and deployment
• For production, script deployment of application and build in to image
• Use -conntype NONE so that server does not have to be running
![Page 22: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/22.jpg)
Data volumes
• Expectation is that WAS traditional containers are long-lived (may be started/stopped multiple times)
• May still be desirable to persist certain files/directories outside of the container e.g. transaction logs or logs
• Also possible to mount the entire profile as a volume to allow it to be moved from one install image to another e.g.
• $ docker run -v /opt/IBM/WebSphere/AppServer/profiles -p 9060:9060 -d websphere-traditional
![Page 23: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/23.jpg)
Building ND images
• Build an install image as for base/developer but using ND binaries
• Create a Deployment Manager image with a dmgr profile
• Create a managed node image• Runs a node agent and application server
• Federates to the deployment manager on startup
• Application server (and application) may be configured in to image at build time (e.g. used as template for cluster member) or created at runtime via deployment manager
• Some configuration (e.g. SIBus cluster members) must be configured via deployment manager
![Page 24: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/24.jpg)
Creating an ND topology
• Create a multi-host overlay network (or use host-level networking)
• $ docker network create cell
• Run deployment manager
• $ docker run --name dmgr -h dmgr --net=cell -p 9060:9060 -d dmgr
• Run application server image that federates to dmgr
• $ docker run --name server1 -h server1 --net=cell -p 9080:9080 -d appserver
![Page 25: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/25.jpg)
Example ND topology
Host A
Host B
Host C
Container
Container
Container
Container
DMgr
Node Agent
App Server
Node Agent
App Server
Node Agent
App Server
![Page 26: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/26.jpg)
Developer Experience
CHAPTER FOUR
![Page 27: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/27.jpg)
WebSphere Developer Tools support for Docker
![Page 28: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/28.jpg)
Debugging Liberty under Docker
![Page 29: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/29.jpg)
Delivery Pipeline
Docker Trusted
Registry
![Page 30: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/30.jpg)
Container Platforms
CHAPTER FIVE
![Page 31: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/31.jpg)
IBM Containers
![Page 32: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/32.jpg)
OpenShift V3
https://developer.ibm.com/wasdev/docs/running-websphere-liberty-openshift-v3/
![Page 33: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/33.jpg)
Docker Datacenter
IBM reseller or Docker Datacenter providing L1 & L2 support: ibm.biz/ddc-announce
Docker Universal
Control Plane
Docker Trusted
Registry
On premises Datacenter Virtual Private Cloud
Docker Engines
Docker Swarm
Docker Datacenter
![Page 34: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/34.jpg)
Docker Universal Control Plane Architecture
UCP Controller
Swarm
Manager
Certificate
AuthorityKV Store
Docker Remote API Docker Remote API
LDAP/ADUser Requests via
Docker Remote API
External CA
HA Replica
Swarm
KV Store
HA Replica
Swarm
KV Store
![Page 35: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/35.jpg)
Datacenter load-balancing reference architecture
https://www.docker.com/sites/default/files/RA_UCP%20Load%20Balancing-Feb%202016_1.pdf
Swarm Master NginxInterlock
Liberty Swarm AgentSwarm Agent Liberty
DockerCompose
HTTP
![Page 36: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/36.jpg)
Interlock/Nginx Compose Configuration
version: '2'
services:
interlock:
image: ehazlett/interlock:1.1.0
command: -D run
ports:
- 8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ucp-node-certs:/certs
restart: always
network_mode: "bridge"
environment:
INTERLOCK_CONFIG: |
ListenAddr = ":8080"
DockerURL = "tcp://ucpfqdn:8888"
TLSCACert = "/certs/ca.pem"
TLSCert = "/certs/cert.pem"
TLSKey = "/certs/key.pem"
[[Extensions]]
Name = "nginx"
ConfigPath = "/etc/nginx/nginx.conf"
PidPath = "/etc/nginx/nginx.pid"
MaxConn = 1024
Port = 80
![Page 37: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/37.jpg)
Interlock/Nginx Compose Configuration
nginx:
image: nginx:latest
entrypoint: nginx
command: -g "daemon off;" -c /etc/nginx/nginx.conf
ports:
- 1234:80
labels:
- "interlock.ext.name=nginx"
depends_on:
- interlock
network_mode: "bridge"
restart: always
volumes:
ucp-node-certs:
external: true
![Page 38: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/38.jpg)
Application Compose Configuration
version: '2'
services:
app:
image: ddc.eval.docker.com/admin/app
ports:
- 9080
depends_on:
- nginx
labels:
- "interlock.hostname=test"
- "interlock.domain=lib"
![Page 39: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/39.jpg)
Voting Application
Java Container
WXS Catalog Container
DB2 Container
WebSphere Liberty Container
Voting App
WebSphere Liberty Container
Result App
Worker
WXS Catalog Container
![Page 40: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/40.jpg)
docker-compose.yml
version: "2”services:
voting-app:image: bceglc260.in.ibm.com/kavitha/votingappports:
- "5000:9080"networks:
- voteappresult-app:image: bceglc260.in.ibm.com/kavitha/resultappports:
- "5001:9080"networks:
- voteappworker:image: bceglc260.in.ibm.com/kavitha/workernetworks:
- voteappwxs:image: bceglc260.in.ibm.com/kavitha/wxscatports:
- "2809:2809“
networks:
- voteapp
container_name: wxs
wxscon:
image: bceglc260.in.ibm.com/kavitha/wxscon
networks:
- voteapp
db:
image: bceglc260.in.ibm.com/kavitha/db2
environment:
DB2INST1_PASSWORD: db2inst1
LICENSE: accept
command: db2start
volumes:
- "db-data:/home/db2inst1/db2inst1"
networks:
- voteapp
container_name: db
volumes:
db-data:
networks:
voteapp:
41
![Page 41: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/41.jpg)
Liberty Collectives
CHAPTER SIX
![Page 42: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/42.jpg)
Dynamic routing with Liberty collectives
Swarm Master IHS/PluginCollective Controller
Liberty Swarm AgentSwarm Agent Liberty
DockerCompose
HTTP
![Page 43: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/43.jpg)
Liberty collectives managing Docker containers
IHS/PluginCollective Controller
Liberty Docker EngineDocker Engine Liberty
LibertyAdmin
HTTP
![Page 44: WebSphere and Docker](https://reader035.vdocument.in/reader035/viewer/2022081502/58a4dbad1a28ab34318b5d8d/html5/thumbnails/44.jpg)
THE END