Skip to content

Commit 46c5a96

Browse files
committed
fix: ecr
1 parent e399770 commit 46c5a96

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

container-uploader/app.mjs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ const buildDockerImage = async (
3636
childProcess.execSync(
3737
`unzip ${runtime.path}_${architecture}.zip -d ${runtime.path}`
3838
);
39-
console.log("runtime = ");
40-
console.log(runtime);
41-
console.log("runtime image");
42-
console.log(runtime.image);
43-
console.log("runtime image base");
44-
console.log(runtime.image.baseImage);
4539
const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64";
4640
const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`;
47-
const cmdLine = `docker build . -f Dockerfile.sample --platform ${platform} -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`;
41+
const cmdLine = `
42+
docker buildx build . \
43+
-f Dockerfile.sample \
44+
--platform ${platform} \
45+
--load \
46+
-t ${tag} \
47+
--build-arg baseImage='${runtime.image.baseImage}' \
48+
--build-arg handlerCode='${runtime.path}' \
49+
--build-arg handlerCmd='${runtime.handler}'
50+
`;
4851
console.log(cmdLine);
4952
childProcess.execSync(cmdLine);
5053
const cmdLogin = `aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${accountId}.dkr.ecr.${region}.amazonaws.com`;
@@ -127,7 +130,7 @@ const runtimeFromRuntimeId = (manifest, runtimeId) => {
127130
const runtime = manifest.find(r => {
128131
return r.path === runtimeId;
129132
});
130-
if(!runtime) {
133+
if (!runtime) {
131134
throw "cound not find the runtime"
132135
}
133136
console.log(runtime);

0 commit comments

Comments
 (0)