C
Coder.com2mo ago
valon

Trouble with including Internal Tool from .tar.gz in Coder Workspace Template

Hey, I've run into an issue where I need to install a specific tool in a Coder workspace, which is packaged as a .tar.gz file. While I understand that the extraction of a tar.gz file can typically be done through the Dockerfile, this particular tool is internal and requires authentication for download, which complicates the process. I attempted to create a Coder template by including the Dockerfile, main.tf, and the .tar.gz file in a zip archive. However, upon trying to upload this zip as a new template, it gets stuck on the build enqueued process. Given that direct download without authorization isn't an option, I'm looking for suggestions on how to properly include and install this tool in a Coder workspace. If there's a known method or strategy for handling such internal tools requiring authentication during the setup within Coder, that would be much appreciated. If any further information would help, please let me know, and thanks in advance for any help.
22 Replies
Codercord
Codercord2mo ago
<#1347194342766284810>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys2mo ago
could you unzip it and try coder templates push? this way you'd get more logs on why the upload is failing it shouldn't hang like that though for including internal tools you do have to download them at some point, the best way to do this would be to handle the build of the Dockerfile in CI and then pushing it to a registry, this way you can download the tools and include them inside the Docker image
valon
valonOP2mo ago
i will probably try this but i am wondering how does coder pull the created image?
Phorcys
Phorcys2mo ago
you give it secrets to access the registry
saun
saun2mo ago
use this
saun
saun2mo ago
it will pull the docker images from the private docker registry and create a workspace seperate from this problem, this template works fine, only have errors on cursor module, let me know if you are able to solve this
valon
valonOP2mo ago
Thanks a lot. I will try this once everything is setup.
Phorcys
Phorcys2mo ago
hey @valon, any luck?
valon
valonOP2mo ago
Sorry, im sick right now so i am not at work for this week and can't try this method.
Phorcys
Phorcys2mo ago
sounds good! get well soon :-) please ping me if you need help
valon
valonOP5w ago
Different Question is there a possibility to extend the upload limit of a template?
Phorcys
Phorcys4w ago
sorry, I didn't see this message i don't think it's possible we set a hardcoded limit because the template files are stored in the database, so we can't afford to store big things in there your template should not be that big usually, you would want to getch resources externally rather than integrating them in the template files
valon
valonOP4w ago
Alright, that makes sense. So i get it that it is possible to pull the image by having the secret in the terraform file but i would like to not have it hardcoded inside my main.tf but rather have it pull the secret from a env variable is that possible?
Phorcys
Phorcys4w ago
yes you can
Phorcys
Phorcys4w ago
DOCKER_REGISTRY_USER and DOCKER_REGISTRY_PASS
valon
valonOP4w ago
so i can put those env variables in the coder.env and that should work?
Phorcys
Phorcys4w ago
yeah i think it should pass those down to terraform
valon
valonOP4w ago
Thank you! I will try this doesn't really seem to work like I thought, because when i try to create the template it always wants to open the config.json but i dont have such a file.
Phorcys
Phorcys4w ago
could you share your terraform code?
valon
valonOP4w ago
Sorry for the late answer. Apparently the error is located at line 18 so I include just a snippet of the terraform code. If you need the full code just tell me. To not confuse you the output function is only a debug option of mine to check if there is even any content in the env variable, because I think that this way doesn't work because the content of the env variable is empty.
No description
Phorcys
Phorcys4w ago
taking a look, please share a text snippet in the future when possible :-) i would like the full code if possible because this shouldn't case the issue, could you also share the error message?

Did you find this page helpful?