Skip to content

Docker ARG parsing doesn't work #455

Open
@twsl

Description

@twsl

Similar to my previous issue #78, ARG parsing is still causing issues.

Using:

docker run -it --rm -v /tmp/envbuilder:/workspaces -e ENVBUILDER_GIT_URL=https://github.com/twsl/whos-there -e ENVBUILDER_INIT_SCRIPT=bash ghcr.io/coder/envbuilder

I get the following error message:

No Dockerfile specified, looking for a devcontainer.json...
Building in Devcontainer mode using /.devcontainer/devcontainer.json
error: compile devcontainer.json: user from dockerfile: parse image ref "mcr.microsoft.com/devcontainers/python:1-${VARIANT}": could not parse reference: mcr.microsoft.com/devcontainers/python:1-${VARIANT}
error: running command "envbuilder": compile devcontainer.json: user from dockerfile: parse image ref "mcr.microsoft.com/devcontainers/python:1-${VARIANT}": could not parse reference: mcr.microsoft.com/devcontainers/python:1-${VARIANT}

The ARG is specified in the devcontainer.json and has a default value in the Dockerfile.

"build": {
        "dockerfile": "Dockerfile",
        "context": "..",
        "args": {
            "VARIANT": "3.11-bookworm"
        }
    },

Am I missing something?

Activity

twsl

twsl commented on Mar 31, 2025

@twsl
Author

It's supposed to be fixed as already mentioned in #35, but it doesnt seem to work any longer or is caused by overwriting it in the devcontainer file?

twsl

twsl commented on Apr 13, 2025

@twsl
Author

I have a test case here, started to debug it and the issue is, that during the resolving of a potential user, the tag gets checked and fails as the variable signs are not allowed in a tag cause at no point the build args are ever used and replaced within the dockerfilecontent

linked a pull request that will close this issue on May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Docker ARG parsing doesn't work · Issue #455 · coder/envbuilder