Code for DockerCon EU 2018
The code in this repo was used in a live demonstration talk for DockerCon EU 2018, titled "Programming the Cloud Using Containers as the Building Block".
In this talk, we construct an application consisting of a Redis instance and a Redis Commander instance. (Thanks to Joe Ferner for creating Redis Commander!)
The code in this repo is split into four subfolders, for easy navigation:
Step1: Contains the code for the "first" step of the DockerCon talk. This code is the "first step" code showcased in the talk, before any modifications were made. This code creates a Docker container for Redis, a Docker container for Redis Commander, and connects the two using a Network.
Step2: Contains the code for the "second" step of the DockerCon talk, where we introduce a
Rediscomponent resource that encapsulates the use of Docker containers.
Step3: Contains the code for the "third" step of the DockerCon talk, where we turn
Redisinto an abstract class and provide implementations of it for Docker and Kubernetes.
Step4: Contains the complete code for a package implementing a Redis component, suitable for publishing to NPM. This package includes some additional code that we did not have time to cover in the talk, most notably an Amazon implementation of the Redis abstraction using AWS ElastiCache.
Every step can be run by
cd-ing into the code directory, creating a stack for the example, installing dependencies, and running
$ cd step1 $ pulumi stack init my-stack-name $ npm install $ pulumi up
At every step, the stack output
host will point to a running Redis Commander instance on your local machine. You can access this service in a web browser by running
open $(pulumi stack output host).