Skip to content

Conversation

@twsl
Copy link

@twsl twsl commented May 24, 2025

I don't have any go skills whatsoever, but here is my attempt to fix #455

@twsl twsl marked this pull request as ready for review December 11, 2025 01:30
hext-dev added a commit to hext-dev/envbuilder that referenced this pull request Jan 14, 2026
This commit improves the code quality of twsl's ARG parsing fix by
extracting the duplicated logic into a reusable helper function.

Changes:
- Add buildArgsWithDefaults() helper that merges external build args
  with ARG defaults from a Dockerfile, respecting precedence rules
- Refactor UserFromDockerfile() to use the new helper
- Refactor ImageFromDockerfile() to use the new helper and simplify
  the FROM instruction finding logic
- Remove debug fmt.Println statements from tests

The original fix (PR coder#463) correctly addressed issue coder#455 where build
args from devcontainer.json were not being used when resolving image
references in Dockerfiles with ARG variables. This refactoring reduces
code duplication while preserving the fix's behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Docker ARG parsing doesn't work

1 participant