Ron Williams presents Docker container management concepts with Yeoman and SASS compilation use cases
Presented during Design4Drupal Boston 2015 at Microsoft NERD Center
Designing for privacy: 3 essential UX habits for product teams
Docker 4 Drupal Themes | Design 4 Drupal Boston 2015
1. Docker 4 Drupal Themes
Presented by :
Ron Williams
With thanks to Ben Hosmer
Integrating Docker into Drupal Theme Development
2. Began developing Wordpress, phpBB, MediaWiki, etc integrations 11
years ago. When needing reliable data migration, I moved to Drupal
for use as a cohesive integration service between multiple
applications.
I founded the Maryland Drupal Developers group in 2007 and was the
organizer until 2012. I worked as Sys Admin for CU-Boulder from
2012-2015.
I currently work for Heartland Technology Group at USDA Enterprise
Application Services.
Background
Concurrent
Experience / Work
Web App Development
Drupal Dev
SEO
Sys Admin
11 yrs
10 yrs
7 yrs
6 yrs
Ron Williams
DevOps Specialist, @Ron_Williams
24. @Ron_Williams - http://ronwilliams.io
Cool dev, but why theme?
• Avoid merge conflicts
• Local development mirrors staging server
• Reliable Windows development
• Reduce software version incompatibilities
39. Connect on Social Media
Follow technology, ask additional questions, learn new strategy as it’s released
@Ron_Williams
RonWilliams.io
Also e-mail hello@ronwilliams.io
Personal blog, portfolio, and technology banter.
Notas del editor
PAUSE!
Then intro MD Drupal group and USDA work. Ignore other content.
Introduce slide content
It is pretty darn cool!
Company valuation went up $500M in last round funding
Analysts believe Microsoft may buy company
Containers allow you to share a single VM with multiple applications.
- Ease New Developer On-Boarding
- Skip waiting for development tool installs & access
- Allow dev to test/break system locally
- Learning system setup locally means developer acclimates to production
- With less VMs or physical machines, you can reduce hosting fees and sys admin labor
- Scale horizontally when ready
Manage configuration during buildout without additional steps.
Build and test the locally or remotely, and reuse on all environments (No it’s not java!).
Systems deployments are more successful
- Devs can inject system dependencies prior to sys admin deployment
- Compose implementation can import all dependencies
Traditional VMs are like trucks.
VMS are not stateless and can change when you start them.
Sys admins sets up a new machine by loading a bunch of services that drive your application.
Application need to handle more traffic, you move the services to other machines to scale horizontally.
Docker containers work like a rocket.
They’re nimble, fast, and serve a specific purpose.
Container technology has been around a while.
Concept of containerization - shared kernel, own processes and network space.
Docker makes it really easy, but didn’t invent containers (LXC).
- http://en.wikipedia.org/wiki/LXC
Started as dot cloud polyglot (multiple language) hosting
Containers are built in to systemd (basic OS building block) already.
Explain the tools to leverage Docker
One process - one container
Lots of shell scripts provisioning a container on run? Think about what you are doing.
Don’t ssh to your containers. (exec bash)
Don’t put everything in one container.
LAMP Stack might run on a VM
The stack consists of two containers running a few logically grouped service
This is a transition slide for commands to use docker
Explain commands
The build commands for a container
This is a portion of the usdaeas/lap-docker Dockerfile.
Dockerfiles are scripted images.
The build commands for a container.
Multiple versions of a container.
Only need one build/image.
Start and stop a container
Can have multiple instances of a container
Look how fast you can start a service!
Use a shared volume on the host. Containers are stateless and you’ll lose your data if you kill your container.
Data can be remapped to a new container after updates.
Secured Socket connection between two defined containers
Checking in compiled sass usually causes merge conflicts with multiple developers
Let the remote deployment and test server perform the final compilation
Easier approval and use of Docker in government on Windows machines
Redistributable working software packages
Show existing containers in use.
Run the silarsis/yeoman container
Access bash within the container after run, then show the mounted www folder
Enter ctrl + p, then ctrl + q to detach from the container.
Run docker ps to show the containers are running.
Execute bash inside of the container.
Navigation to your sites directory.
Install the generator-drupal-theme
The npm install command comes right from the Aurora theme page.
No need for yeoman! It’s already installed.
switch to regular use again
Go through the usual yeoman theme setup.
Complete the install and the Drupal files are generated.
Let’s exit and switch to the dev container.
Exec into the standard usdaeas/lap-docker container.
Change directory into the drupal sites/all/themes/new theme
Perform the usual gem install bundler
Gemfile now exists with appropriate versions.
Problem: Default POSIX does not handle all characters
Set a utf-8 environment variable.
Start compass watch to poll and overwrite files.
New changes to sass files are captured and update the style.css.
Thanks for attending.
If you liked the session, consider following on Twitter. I post technical and strategic information related to Docker, general sys admin practices, and web application development.
Open for questions.