- Notifications
You must be signed in to change notification settings - Fork1.1k
feat(scripts): create both docker and tasks-docker templates by default for develop.sh#21184
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bpmct commentedDec 9, 2025
I have confirmed this works! |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a82d8b2 to34d30a5CompareAdd a --with-tasks flag to develop.sh that automatically sets upa tasks-compatible development environment. When enabled, it createsthe tasks-docker template and pulls the required container image inthe background to speed up workspace creation.The flag also sets a blank access URL to enable tunnel mode, whichprovides automatic subdomain support for workspace apps withoutrequiring wildcard-access-url configuration.Updated the dogfood template to use this flag by default, making iteasier to develop Coder Tasks features using Tasks itself.🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The DOCKER_HOST variable was being set but not passed to the template.This commit:- Creates params.yaml with docker_socket parameter- Passes params.yaml via --variables-file flag to both template pushes- Adds docker_socket variable to tasks-docker template matching docker template patternThis ensures the template can connect to non-default Docker sockets when needed.
Per Dean's feedback, remove the --with-tasks flag and always createboth the docker and tasks-docker templates in develop.sh. This providesa better developer experience by making the tasks-docker templateavailable without requiring a flag.Changes:- Remove --with-tasks flag and associated argument parsing- Always create both docker and tasks-docker templates when docker is available- Pull container image in background for tasks-docker to speed up workspace creation- Update dogfood template to remove --with-tasks usage (no longer needed)
The main.tf changes were unrelated to this PR. Reverting to match mainbranch exactly.
4e115ea tof98cf44CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Addresses Dean's code review feedback:- Remove redundant first_org_name variable in tasks-docker section (already defined in docker section above)- Extract template pushing logic into a shared push_template() function to reduce code duplication between docker and tasks-docker template creation
…lateThe tasks-docker example template doesn't need custom docker socketconfiguration - it works fine with the default docker provider configuration.Removed the docker_socket variable addition and updated push_template()function to optionally use params.yaml only when it exists.
| DOCKER_HOST="$(docker context inspect --format'{{ .Endpoints.docker.Host }}')" | ||
| printf'docker_arch: "%s"\ndocker_host: "%s"\n'"${GOARCH}""${DOCKER_HOST}">"${temp_template_dir}/params.yaml" | ||
| ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not a big deal but the parenthesis are not required anymore.
| if docker info>/dev/null2>&1&&!"${CODER_DEV_SHIM}" templates versions list"${template_name}">/dev/null2>&1;then | ||
| # sometimes terraform isn't installed yet when we go to create the | ||
| # template | ||
| echo"Waiting for terraform to be installed..." | ||
| sleep 5 | ||
| echo"Initializing tasks-docker template..." | ||
| # Pull the container image in the background to speed up workspace creation | ||
| container_image="codercom/example-universal:ubuntu" | ||
| echo"Pulling container image${container_image} in background..." | ||
| docker pull"${container_image}">/dev/null2>&1& | ||
| # Create template from the examples directory | ||
| temp_template_dir="$(mktemp -d)" | ||
| cp -r"${PROJECT_ROOT}/examples/templates/tasks-docker/"*"${temp_template_dir}/" | ||
| # Run terraform init so we get a terraform.lock.hcl | ||
| pushd"${temp_template_dir}"&& terraform init&&popd | ||
| ( | ||
| push_template"${template_name}""${temp_template_dir}""${first_org_name}""${another_org}" | ||
| )||echo"Failed to create tasks-docker template. The template files are in${temp_template_dir}" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can we not make the regulardocker template the same as this? It's missing the terraform check, the background pulling, theterraform init. It'd be nice if these could just be identical and just be ~two lines
| # sometimes terraform isn't installed yet when we go to create the | ||
| # template | ||
| echo"Waiting for terraform to be installed..." | ||
| sleep 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This needs to be a (bounded) loop withcommand -v terraform or something to test for it being installed rather than a sleep
Uh oh!
There was an error while loading.Please reload this page.
Remove the
--with-tasksflag and always create both docker and tasks-docker templates in develop.sh. This provides a better developer experience by making the tasks-docker template available automatically without requiring a flag.When docker is available, the script now:
examples/templates/tasks-dockercodercom/example-universal:ubuntu) in the background to speed up workspace creation🤖 Generated withClaude Code
Co-Authored-By: Claude Sonnet 4.5noreply@anthropic.com