Moving Legacy Applications to Docker Josh Ellithorpe Software















- Slides: 15
Moving Legacy Applications to Docker Josh Ellithorpe Software Architect
Agenda Auditing Resources Networking Data Services Dependencies Kernel Configuration Templates / ENV Service Discovery Lifecycle Build vs. Deploy App Updates
Auditing
Resources • CPU • Multi-core runtime? • Average load • Disk • Memory • Consumption while running • Network
Networking / Connectivity • • Required TCP/UDP ports External service connectivity Certificates/SSL Latency / Bandwidth Useful Tools: • • tcpdump netstat lsof -P netdata
Data Services / Storage • Where does your app write data to the filesystem? • What persistent datastore do you want to use? (NFS/CIFS/etc) • What databases or other data services are required? What are their connection details? Useful Tools: • strace • lsof
Dependencies • What OS is required? • What packages are needed to run the app? • Runtime • Shared libraries • What application dependencies are required? • NPM modules, gems, etc. Useful Tools: • ld • strace • lsof
Kernel • Does your app require a privileged container? • Does your app require custom kernel modules/parameters?
Configuration
Templates / ENV Variables • Can the application read ENV vars? • Does it require a startup script to setup the container before the application/service starts? Recommendations: • Write the entire config in the start script instead of using sed/awk
Service Discovery • • Etcd / Zookeeper Consul DNS Static Values
Lifecycle
Build / Deploy / Runtime Understand where your concerns are. • Build • Dependencies, required ports, and startup scripts • Deploy • Persistent volumes, network context, and scheduling • Runtime • Writing needed configurations via start script • Consuming services from service discovery system • Clean startup and shutdown
App Updates Traditional VM based deployments only update the application, however when using containers you must rebuild the entire dependency set down to the OS. It is critical to create an automated build process to handle this. That way it can pull in the new dependencies you need, and script out the generation of your Dockerfile.
Thank you!