Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ new assets.Asset(stack, 'BundledAsset', {
`,
],
network: 'host',
platform: 'linux/amd64',
},
});
/// !hide
Expand Down
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/core/lib/private/asset-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class AssetBundlingBindMount extends AssetBundlingBase {
...(this.options.volumes ?? []),
],
network: this.options.network,
platform: this.options.platform,
});
}
}
Expand Down Expand Up @@ -189,6 +190,7 @@ export class AssetBundlingVolumeCopy extends AssetBundlingBase {
this.copyContainerName,
...(this.options.volumesFrom ?? []),
],
platform: this.options.platform,
});

this.copyOutputTo(this.options.bundleDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('bundling', () => {
bundleDir: '/tmp/output',
image: DockerImage.fromRegistry('public.ecr.aws/docker/library/alpine'),
user: '1000',
platform: 'linux/amd64',
};
const helper = new AssetBundlingVolumeCopy(options);
helper.run();
Expand Down Expand Up @@ -78,6 +79,7 @@ describe('bundling', () => {
// actual docker run
expect(spawnSyncStub.calledWith(DOCKER_CMD, sinon.match.array.contains([
'run', '--rm',
'--platform', 'linux/amd64',
'--volumes-from', helper.copyContainerName,
'public.ecr.aws/docker/library/alpine',
]), { encoding: 'utf-8', stdio: ['ignore', process.stderr, 'inherit'] })).toEqual(true);
Expand All @@ -100,6 +102,7 @@ describe('bundling', () => {
image: DockerImage.fromRegistry('public.ecr.aws/docker/library/alpine'),
user: '1000',
network: 'host',
platform: 'linux/amd64',
};
const helper = new AssetBundlingBindMount(options);
helper.run();
Expand All @@ -108,6 +111,7 @@ describe('bundling', () => {
expect(spawnSyncStub.calledWith(DOCKER_CMD, sinon.match.array.contains([
'run', '--rm',
'--network', 'host',
'--platform', 'linux/amd64',
'-v',
'public.ecr.aws/docker/library/alpine',
]), { encoding: 'utf-8', stdio: ['ignore', process.stderr, 'inherit'] })).toEqual(true);
Expand Down
Loading