Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

🐞 Type mismatch with BuildArg in Docker build operations #13

@quanta42

Description

@quanta42

What is the issue?

@shykes I love the presentation you did with dagger and llm.

I tried building a prototype during innovation week at work but when attempting to build a Docker image with build arguments in both Go and Python SDKs, there's a type conversion error at the GraphQL layer.

Is there a workaround for this?

Dagger version

dagger v0.17.0-llm.2

Steps to reproduce

  • Create a Dockerfile that uses build arguments:
FROM ${NVIDIA_DOCKER_VERSION}
ARG NVIDIA_DRIVER_VERSION
ARG PYTORCH_VERSION
# ...other build args
  • Try to build using Go SDK
buildArgs := []dagger.BuildArg{
    {Name: "NVIDIA_DOCKER_VERSION", Value: "nvidia/cuda:12.4.1-runtime-ubuntu22.04"},
    {Name: "NVIDIA_DRIVER_VERSION", Value: "535.129.03"},
    {Name: "PYTORCH_VERSION", Value: "2.6.0"}
}

container := sourceDir.DockerBuild(dagger.DirectoryDockerBuildOpts{
    Dockerfile: "Dockerfile.advanced",
    BuildArgs: buildArgs,
})

Log output

error: parse selections: parse field "dockerBuild": init arg "buildArgs" value as dagql.DynamicOptional ([BuildArg!]) using dagql.DynamicOptional: assign input object "Name" as NVIDIA_DOCKER_VERSION (dagql.String): cannot assign dagql.String into field of type string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions