Kubernetes and other cloud-native strategies might be putting configuration management out to pasture, but I found myself writing a playbook recently while learning how to create infrastructure as code for Azure. I needed to start my Flask web server and Postgres database with systemd, which isn’t a pattern that’s easily supported by Docker. I got this working with Docker Compose, however, and this post will show you how! Create a Docker Compose file with the following services: version: '2. … »
Here’s a really quick test to see if your enterprise Java app is ready for Docker. NOTE: I am not a Java developer; more like a casual observer. Get your pitchforks ready! If I can’t do this: $> docker run --rm --volume "$PWD:/app" --volume "$HOME/.m2:/root/.m2" \ --tty maven:3.6.0-jdk$WHICHEVER_VERSION-alpine mvn build $> docker run --rm --volume "$PWD:/app" --tty openjdk:$WHICHEVER_VERSION-jdk-alpine \ java -jar /path/to/war.war Then either: Your application is not 12-factor and is probably not ready for Docker, Your source code has hidden dependencies that live outside of your pom. … »
Intro I was in high school when I got introduced to this weird app called VMware Workstation. I thought the idea of using your Windows machine to run other machines was really compelling - a perfect fit of my younger and geekier self. You couldn’t pay me enough back then to believe that almost all[^1] of the world’s most important applications would eventually run on virtual machines…on someone else’s computers! I really liked the idea, but Workstation was a bit of a bear to use at the time and the virtual machines it created were quite slow. … »
You want to use Ansible’s
docker_container module to do stuff, but want to also perform actions based on their output without specifying a logging driver or writing to a temp file.
Do this:… »
Edit 2: I’ve made a few small changes to the way I’ve described Docker architecture. Thanks, /u/jmtd!
Edit: I mentioned below that Docker containers can only run a single process. While that is true by default, it is actually not the rule. You can use Docker Supervisor to manage multiple processes within a container. Here is how you do that. Thanks, /u/carlivar!
Fact: There are at least 22 conversations arguing about the usefulness/uselessness of containers happening right now. For every person arguing about them, at least three blog articles will shortly appear telling you why containers are going to be bigger than the Super Bowl or how they are the worst thing to happen to computing since web scale became a thing.
This short post will not be any of those.
I believe in using the right tool for the job and I hate fads. I’ve also been learning about containers for the last few months and am becoming incredibly interested in figuring out how to bring them to Windows 2012 and below (Windows Server 2016+ will have them, but Microsoft will be lucky and probably scared if they saw anything above 20-30% uptake within its first two years), so here’s a short post describing what I’ve learned about them, how they work, and why they might or might not be useful for you and/or your business.… »