Pass additional arguments to coder_devcontainer #21534
Replies: 2 comments 1 reply
-
|
I've got a halfway workaround, but it has two big caveats: # Automatically start the devcontainer for the workspace
# NOTE: the "rebuild" button in coder will effectively drop any extra arguments
# until the workspace is restarted and this script runs again.
# NOTE: if you use the override config to set customizations, the agent won't
# see them, because it gets configuration by calling
# `devcontainer read-configuration`.
resource "coder_script" "start_container" {
count = data.coder_workspace.me.start_count
agent_id = coder_agent.sysbox.id
display_name = "devcontainer"
icon = "/icon/container.svg"
script = <<-EOF
timeout 60s sh -c 'until command -v devcontainer > /dev/null 2>&1; do sleep 1; done'
devcontainer up --workspace-folder ~/"${module.git-clone[0].folder_name}" \
${data.coder_parameter.dotfiles_url.value == "" ? "" : "--dotfiles-repository \"${data.coder_parameter.dotfiles_url.value}\""}
EOF
run_on_start = true
} |
Beta Was this translation helpful? Give feedback.
-
|
Another reason that this would be useful: I want |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be nice to be able to pass additional arguments to the
coder_devcontainerresource:This hypothetical "additional_args" option would just get fed all the way to the devcontainer up call. If this feature existed, it could be used for a bunch of things:
--dotfiles-repository/--dotfiles-install-command/--dotfiles-target-path--additional-features--cache-to/--cache-from--mount/--secrets-file/--remote-envIt seems straightforward to implement, but it requires modifying the terraform provider as well as the coder agent.
Beta Was this translation helpful? Give feedback.
All reactions