heroku 9.3.0-alpha.0 → 9.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,13 @@ class Push extends command_1.Command {
60
60
  else {
61
61
  core_1.ux.styledHeader(`Building ${job.name} (${job.dockerfile})`);
62
62
  }
63
- await DockerHelper.buildImage(job.dockerfile, job.resource, buildArgs, contextPath);
63
+ await DockerHelper.buildImage({
64
+ dockerfile: job.dockerfile,
65
+ resource: job.resource,
66
+ buildArgs,
67
+ path: contextPath,
68
+ arch: this.config.arch,
69
+ });
64
70
  }
65
71
  }
66
72
  catch (error) {
@@ -19,6 +19,14 @@ export declare type groupedDockerJobs = {
19
19
  export declare const getJobs: (resourceRoot: string, dockerfiles: string[]) => groupedDockerJobs;
20
20
  export declare const filterByProcessType: (jobs: groupedDockerJobs, processTypes: string[]) => groupedDockerJobs;
21
21
  export declare const chooseJobs: (jobs: groupedDockerJobs) => Promise<dockerJob[]>;
22
- export declare const buildImage: (dockerfile: string, resource: string, buildArgs: string[], path?: string) => Promise<string>;
22
+ declare type BuildImageParams = {
23
+ dockerfile: string;
24
+ resource: string;
25
+ buildArgs: string[];
26
+ path?: string;
27
+ arch?: string;
28
+ };
29
+ export declare const buildImage: ({ dockerfile, resource, buildArgs, path, arch }: BuildImageParams) => Promise<string>;
23
30
  export declare const pushImage: (resource: string) => Promise<string>;
24
31
  export declare const runImage: (resource: string, command: string, port: number) => Promise<string>;
32
+ export {};
@@ -140,9 +140,13 @@ const chooseJobs = async function (jobs) {
140
140
  return chosenJobs;
141
141
  };
142
142
  exports.chooseJobs = chooseJobs;
143
- const buildImage = async function (dockerfile, resource, buildArgs, path) {
143
+ const buildImage = async function ({ dockerfile, resource, buildArgs, path, arch }) {
144
144
  const cwd = path || Path.dirname(dockerfile);
145
- const args = ['build', '-f', dockerfile, '-t', resource, '--platform', 'linux/amd64'];
145
+ const args = ['build', '-f', dockerfile, '-t', resource];
146
+ // Older Docker versions don't allow for this flag, but we are
147
+ // adding it here when necessary to allow for pushing a docker build from m1/m2 Macs.
148
+ if (arch === 'arm64')
149
+ args.push('--platform', 'linux/amd64');
146
150
  for (const element of buildArgs) {
147
151
  if (element.length > 0) {
148
152
  args.push('--build-arg', element);