Docker for AWS Greengrass
Development, testing, simulations are all good reasons towant to run AWS Greengrass Core in a docker container. This repo provides a simple Ubuntu-based Greengrass Core Docker image.
The trick to running it in Docker is to use
devicemapper storage driver instead of default
overlay2 (thanks AWS support for digging it out).
CAUTION: when you change the Docker storage driver, you won't see the images and containers created with the old storage driver, until you change it back. Details here
Build the AWS Greengras image
docker build -t aws-greengrass .
Run the AWS Greengrass container
Place your Greengrass Core certificates and keys under
config/to point to the certificates and emails
When you create a Greengrass Core in AWS console, and Download and store your Core's security resources, the download contains the certificates and core configuration. Just copy them over here to
Run the container:
docker run --rm -it \ -v "$PWD/certs":/greengrass/certs \ -v $PWD/config:/greengrass/config \ --privileged \ aws-greengrass
Or use docker-compose:
For MacOS and Windows users
You can build the image on MacOS and Windows, but can not run it.
devicemapper trick doesn't work for MacOS or Windows, as Docker doesn't support the
devicemapper storage driver there.
Instead, use the Vagrant Ubuntu VM: docker is installed and configured to use
Create the VM with
vagrant up, log inside with
and proceed with the steps before. Either pull the image from Docker Hub, or just rebuild it inside Vagrant VM.