Cloud Device Driver (CDD) is a framework that makes developers more efficient when writing Lambda
code for Greengrass Cores. See the CDDBaseline
README for more information.
This is a function that allows you to send commands to the Docker daemon running on a Greengrass host. It allows you to start and stop containers, list the current running containers, and pull containers from ECR using the role associated with your Greengrass Core.
Yes. There are several convenience scripts you can use to see if the function is working for you.
list.sh
- Lists available images and currently running containerspull.sh
- Pulls a container from ECR or a public registryrun.sh
- Runs a container by name (repo tag)stop.sh
- Stops a container by name (repo tag) or ID
These scripts interact with the Greengrass core via MQTT. To receive the responses an MQTT client will need to be connected
and subscribed to the ${AWS_IOT_THING_NAME}/cdd/docker/response
topic. All requests are sent on the
${AWS_IOT_THING_NAME}/cdd/docker/request
topic.
./list.sh ${AWS_IOT_THING_NAME}
The response on the response topic will contain JSON objects with the details of all locally available images and running containers
Pull the latest version of a public Docker image (e.g. arm32v7/hello-world) with no authentication
./pull.sh ${AWS_IOT_THING_NAME} arm32v7/hello-world
Pull a specific version of a public Docker image (e.g. arm32v7/hello-world:linux) with no authentication
./pull.sh ${AWS_IOT_THING_NAME} arm32v7/hello-world:linux
Pull a Docker image from ECR (e.g. repository/image) with the Greengrass core's role
Replace ACCOUNT_ID
, REGION
, repository
and image
with the appropriate values
./pull.sh ${AWS_IOT_THING_NAME} ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/repository:image
Run a specific version of a public Docker image (e.g. arm32v7/hello-world:latest)
./run.sh ${AWS_IOT_THING_NAME} arm32v7/hello-world:latest
Run an ECR image
Replace ACCOUNT_ID
, REGION
, repository
and image
with the appropriate values
./run.sh ${AWS_IOT_THING_NAME} ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/repository:image
Stop a container by its full ID (only exact matches are supported)
./stop.sh ${AWS_IOT_THING_NAME} 6b670c2e8cafcfb0546b4bcab6527cbaa2a8756ff94b7b449e846f0f1525f886
Stop a container by tag name (only one container will be stopped if there are multiple containers running from the same tag):
Replace ACCOUNT_ID
, REGION
, repository
and image
with the appropriate values
./stop.sh ${AWS_IOT_THING_NAME} ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/repository:image