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

verify-dockerfile: does not recognize default parameter substitution #434

Closed
Dentrax opened this issue Jul 13, 2021 · 3 comments
Closed

Comments

@Dentrax
Copy link
Member

Dentrax commented Jul 13, 2021

Description

Minimal reproduce:

  • Set the $BUILDPLATFORM env to arm/v7.

Happy-path test case:

FROM --platform=${BUILDPLATFORM} golang:1.16.3-alpine3.13 AS builder
  • Unset the $BUILDPLATFORM env.

Failing test case:

FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16.3-alpine3.13 AS builder

i.e.:

{
	name:         "digest-platform",
	fileContents: `FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16.3-alpine3.13 AS builder`,
	expected:     []string{"golang:1.16.3-alpine3.13"},
},

getImageFromLine() function returns --platform= instead of --platform=linux/amd64

P.S: This is a limitation of os.ExpandEnv functions. Go currently does not support this feature. We may need to use a custom framework to make a workaround to fix this.

cc: @developer-guy

Dentrax added a commit to Dentrax/cosign that referenced this issue Jul 27, 2021
Fixes sigstore#434

Signed-off-by: Furkan <furkan.turkal@trendyol.com>
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant