Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image resource on Windows without default platform results in invalid platform selection #535

Closed
AaronFriel opened this issue Mar 13, 2023 · 0 comments · Fixed by #537
Closed
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@AaronFriel
Copy link
Contributor

AaronFriel commented Mar 13, 2023

When building an image like so on Windows:

name: image-yaml
description: A Docker image build
runtime: yaml
config: {}
variables: {}
resources:
  demo-image:
    type: docker:Image
    properties:
      imageName: username/image:tag1
      skipPush: true
      build:
        context: ./app
    options:
      version: v4.0.0
outputs:
  imageName: ${demo-image.imageName}

With this Dockerfile:

FROM busybox:latest

COPY test.txt /

CMD ["cat", "test.txt"]

The program fails with:

  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::image-yaml::pulumi:pulumi:Stack::image-yaml-dev]
Building your image for windows\amd64 architecture.
To ensure you are building for the correct platform, consider explicitly setting the `platform` field on ImageBuildOptions.
    ~ docker:index/image:Image: (update)
        [id=username/image:tag1]
        [urn=urn:pulumi:dev::image-yaml::docker:index/image:Image::demo-image]
        [provider=urn:pulumi:dev::image-yaml::pulumi:providers:docker::default_4_0_0::50a92873-b9b3-40a7-b40a-f79f25bfcb1c]
      + build: {
          + context      : "./app"
          + contextDigest: "3ee3eaa9c20ce94aa69bd6d4752ad2cb5c114b1218aa326ac1b37d32f498cf0a"
          + platform     : "windows\\amd64"
        }
Building the image
error: Error response from daemon: "windows\\amd64" is an invalid component of "windows\\amd64": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
error: update failed

This appears to be the result of joining "windows" and "amd64" via filepath.Join().

@AaronFriel AaronFriel added the kind/bug Some behavior is incorrect or out of spec label Mar 13, 2023
@AaronFriel AaronFriel changed the title Building on Windows without platform set results in error Image resource on Windows without platform set results in error Mar 13, 2023
@AaronFriel AaronFriel added the p1 A bug severe enough to be the next item assigned to an engineer label Mar 13, 2023
@AaronFriel AaronFriel changed the title Image resource on Windows without platform set results in error Image resource on Windows without default platform results in invalid platform selection Mar 13, 2023
@AaronFriel AaronFriel self-assigned this Mar 13, 2023
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Mar 14, 2023
@AaronFriel AaronFriel added this to the 0.86 milestone Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
2 participants