Skip to content

Add platform arg to run container options#259

Merged
bwateratmsft merged 5 commits intomainfrom
copilot/fix-258
Jun 3, 2025
Merged

Add platform arg to run container options#259
bwateratmsft merged 5 commits intomainfrom
copilot/fix-258

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2025

This PR adds support for specifying a target platform when running containers, similar to how it's already supported for building images.

The changes include:

  • Added a platform?: ContainerPlatform; property to RunContainerCommandOptions interface
  • Updated getRunContainerCommandArgs method to use withDockerPlatformArg(options.platform)
  • Added test to verify the platform flag is properly included in the command

This allows users to specify the target platform directly through the API instead of having to construct it through CLI strings manually or use customOptions (which doesn't parse correctly for this use case).

Example usage:

const client = new DockerClient();
await client.runContainer({
  imageRef: 'myimage',
  platform: {
    os: 'linux',
    architecture: 'arm64'
  }
});
// Generates: docker container run --platform linux/arm64 myimage

Fixes #258.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Copilot AI changed the title [WIP] Add platform arg to run container options Add platform arg to run container options May 19, 2025
Copilot AI requested a review from bwateratmsft May 19, 2025 20:32
Comment thread packages/vscode-container-client/src/clients/DockerClientBase/DockerClientBase.ts Outdated
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Comment thread package.json Outdated
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
Comment thread package-lock.json
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
@bwateratmsft bwateratmsft marked this pull request as ready for review June 3, 2025 18:33
@bwateratmsft bwateratmsft requested a review from a team as a code owner June 3, 2025 18:33
@bwateratmsft bwateratmsft enabled auto-merge (squash) June 3, 2025 18:46
@bwateratmsft bwateratmsft merged commit 037c03f into main Jun 3, 2025
3 checks passed
@bwateratmsft bwateratmsft deleted the copilot/fix-258 branch June 3, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add platform arg to run container options

4 participants