sparse-intern-71089
04/28/2023, 3:40 PMmysterious-family-43099
04/28/2023, 4:11 PMmysterious-family-43099
04/28/2023, 7:04 PMtrue
and this configuration:
if (dockerArgs) {
// Need this for caching to work properly
dockerArgs.BUILDKIT_INLINE_CACHE = "1";
}
else {
dockerArgs = {}
}
// Build and push the image to ECR.
// TODO: Docker images get built and pushed every time if things haven't changed.
// This is a bug: <https://github.com/pulumi/pulumi-docker/issues/132>
// See if we can fix this by using git hashes.
const image = repo.buildAndPushImage({
context: `../../../${project}`,
...(dockerfileName && {
dockerfile: `../../../${project}/${dockerfileName}`,
}),
...(dockerArgs && {args: dockerArgs}),
args: dockerArgs,
env: {
DOCKER_BUILDKIT: '1',
},
// We need this to build images on M1 architecture.
extraOptions: ['--platform=linux/amd64', '--quiet'],
extraOptions: ['--platform=linux/amd64', '--quiet', '--load'],
// Support docker layer caching by pulling the latest image
cacheFrom: { stages: ['pre-deps', 'deps', 'build']},
target: 'final'
});
mysterious-family-43099
04/28/2023, 7:05 PM