- Newest
- Most votes
- Most comments
The issue is that docker is a pre-requisite of aws.greengrass.DockerApplication, while in your case you are installing docker via the docker-compose-dependencies component which is only a dependency of your docker-compose-yaml component. When Greenrass tried to pull the docker: container images artifacts, it fails since docker is not yet installed.
While I would recommend to install dependencies such as docker, language run-times, etc, as part of the device system image, you can:
-
Replace the
docker:artifacts withs3:artifacts, storing the container images in S3 and loading them up in your recipeRun:lifecycle viadocker load {artifacts:path}/image.tar.gz. The advantage of this approach is that the image is downloaded before your current component is stopped, thus limiting the downtime -
Remove the container images from the artifacts section and perform a
docker pull <image>in your recipeRun:lifecycle. This allows you to leverage the container registry and not have to export the image to S3, but will cause a longer downtime, since your current component will be stopped before the new image gets pulled from the registry. -
Install docker on the system, and only keep
curl -L https://github.com/ubiquiti/docker-compose-aarch64/releases/download/1.22.0/docker-compose-Linux-aarch64 -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose"as part of yourdocker-compose-dependenciescomponent. -
Ensure
docker-compose-dependenciesis deployed to the device before deploying thedocker-compose-yamlcomponent (or any other component depending onaws.greengrass.DockerApplication.
i am trying to deploy the docker-compose as a component and i am getting an error saying no basic credentials, not sure how are you passing the authentication. below is my recipe.yaml
`{
"RecipeFormatVersion": "2020-01-25",
"ComponentName": "com.example.veriSpotComponent",
"ComponentVersion": "3.0.1",
"ComponentType": "aws.greengrass.generic",
"ComponentDescription": "A component that uses Docker Compose to run verispot images from public Amazon ECR.",
"ComponentPublisher": "Amazon",
"ComponentDependencies": {
"aws.greengrass.DockerApplicationManager": {
"VersionRequirement": ">=2.0.0 <2.1.0",
"DependencyType": "HARD"
},
"aws.greengrass.TokenExchangeService": {
"VersionRequirement": ">=2.0.0 <2.1.0",
"DependencyType": "HARD"
}
},
"Manifests": [
{
"Platform": {
"os": "all"
},
"Lifecycle": {
"run": "docker-compose -f {artifacts:path}/docker-compose.yml up -d",
"shutdown": "docker-compose -f {artifacts:path}/docker-compose.yml down"
},
"Artifacts": [
{
"Uri": "s3://grrengrasspoc-****************/verispot/docker-compose.yml",
"Digest": "MT9c7w6NwdrNwKob5MG5qWNHOHegeZMeXfnBfjZfJks=",
"Algorithm": "SHA-256",
"Unarchive": "NONE",
"Permission": {
"Read": "OWNER",
"Execute": "NONE"
}
}
]
}
],
"Lifecycle": {}
}`
Relevant content
- asked 3 years ago
- asked a year ago

Thanks a lot for your answer!
latest, the image might not endup being the one you expect since Greengrass might not pull it from the repodocker-compose-dependenciescomponent has been already deployed to the devices where you want to deploydocker-compose-yaml.