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

FROM command does not honor ENV variables #439

Closed
mtsyganov opened this issue Nov 8, 2018 · 2 comments · Fixed by #834
Closed

FROM command does not honor ENV variables #439

mtsyganov opened this issue Nov 8, 2018 · 2 comments · Fixed by #834
Assignees
Labels
area/dockerfile-command For all bugs related to dockerfile file commands good first issue Good for newcomers help wanted Looking for a volunteer! kind/bug Something isn't working kind/enhancement New feature or request priority/p1 Basic need feature compatibility with docker build. we should be working on this next.

Comments

@mtsyganov
Copy link

Actual behavior
When I create a new image from the base image registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee, I get an error

Expected behavior
Image is downloaded and parsed successfully same as docker do.

To Reproduce
Steps to reproduce the behavior:

  1. build an image from base image registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee
  2. receive error message
INFO[0000] Downloading base image "registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee" 
error building image: getting stage builder for stage 0: could not parse reference

Additional Information

  • Dockerfile
    FROM registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee as assets
@priyawadhwa
Copy link
Collaborator

Hey @mtsyganov what version of the kaniko image are you using? I tried with gcr.io/kaniko-project/executor:v0.6.0 and gcr.io/kaniko-project/debug-v0.6.0 and they both build the image successfully.

@mtsyganov
Copy link
Author

@priyawadhwa you are right.
I am sorry, I misunderstood the bug. The real problem is that kaniko dont handle correct the " in the FROM command when I use variables.

following Dockerfile will fail

ARG ASSETS_IMAGE="registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee"
FROM ${ASSETS_IMAGE} as assets

but this Dockerfile will succeed

ARG ASSETS_IMAGE=registry.gitlab.com/gitlab-org/gitlab-ee/gitlab-assets-ee:11-5-stable-ee
FROM ${ASSETS_IMAGE} as assets

In docker build both cases works fine

@priyawadhwa priyawadhwa added kind/feature-request kind/enhancement New feature or request kind/bug Something isn't working and removed kind/feature-request labels Nov 12, 2018
@bobcatfish bobcatfish added help wanted Looking for a volunteer! good first issue Good for newcomers labels Dec 3, 2018
@donmccasland donmccasland changed the title error building image: getting stage builder for stage 0: could not parse reference FROM command does not honor ENV variables Sep 20, 2019
@donmccasland donmccasland added area/dockerfile-command For all bugs related to dockerfile file commands priority/p1 Basic need feature compatibility with docker build. we should be working on this next. labels Sep 20, 2019
@cvgw cvgw self-assigned this Oct 24, 2019
cvgw added a commit to cvgw/kaniko that referenced this issue Oct 24, 2019
* Strip out double quotes enclosing ARG value after parsing
dockerfile
cvgw added a commit to cvgw/kaniko that referenced this issue Oct 25, 2019
Add additional tests to ensure that ARG values with quotes
are handled properly
cvgw added a commit to cvgw/kaniko that referenced this issue Oct 25, 2019
Add additional tests to ensure that ARG values with quotes
are handled properly
cvgw added a commit to cvgw/kaniko that referenced this issue Oct 25, 2019
Add additional tests to ensure that ARG values with quotes
are handled properly
cvgw added a commit to cvgw/kaniko that referenced this issue Oct 25, 2019
tejal29 added a commit that referenced this issue Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dockerfile-command For all bugs related to dockerfile file commands good first issue Good for newcomers help wanted Looking for a volunteer! kind/bug Something isn't working kind/enhancement New feature or request priority/p1 Basic need feature compatibility with docker build. we should be working on this next.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants