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

Expand Dockerfile directives in devcontainer with environment variables and build args when detecting user, image, etc. #344

Open
mafredri opened this issue Sep 12, 2024 · 0 comments

Comments

@mafredri
Copy link
Member

While working on #343 I noticed that the devcontainer package doesn't parse Dockerfiles such that environment variables or build args are expanded. This means that user/image detection won't be possible in all situations.

For instance, the following:

FROM ubuntu
ARG myuser=1000:1000
USER ${myuser}

Would result in the user being interpreted as the literal string ${myuser}.

I haven't looked into it, but maybe we can utilize the Expand method on the instructions: https://github.com/moby/buildkit/blob/3d8779b9dd07262f927224ef4e828068bb97e3fd/frontend/dockerfile/instructions/commands.go#L415

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

No branches or pull requests

2 participants