millions-furniture-75402
01/06/2023, 2:10 PMv2
to the server...
const lambdaImage = new docker.Image(`${appName}-image`, {
build: { ... },
registry: {
server: "<http://localhost:4566/>",
username: "test",
password: "test",
},
imageName: `${appName}-image`,
});
docker:image:Image (test-app-image):
error: Error response from daemon: login attempt to <http://localhost:4566/v2/> failed with status: 404 Not Found
error: Error: ' docker login' failed with exit code 1
aws.sdk.config.credentials = {
accessKeyId: "test",
secretAccessKey: "test",
};
aws.sdk.config.region = aws.config.region;
and
imageName: `localhost:4510/${appName}-image`,
docker login
.
On the creation of a new repository, ECR in localstack starts the http server.
When using awsx to create the repository, this also impies docker login
. docker login
is happening before the http server is ready and causes the failure above.
To work around, I use the aws cli to create a fake repository, to get the ECR http server running before docker login
.