C
Coder.com5mo ago
Joerg

Questions about Coder and devcontainer

I have been watching some YouTube videos about Coder. Coder seems to be exactly the solution I am looking for. Unfortunately, I have some comprehension issues regarding the devcontainer. I have installed Coder on a VM using Docker-compose. Login is via a subdomain. I have several projects in Astro, LaTeX, R/R-Studio and in the C programming language. My projects are stored in GitHub/GitLab. That means that all Astro projects in the Astro Template and all LaTeX Projects in a LaTeX Template? Could you please show how to set up a Docker template (devcontainer) and a workspace for Astro, for example. How all extensions and additional software are installed. Saving the project on the local hard disk and saving it in GitHub/GitLab. Git pull, git clone. How do I back up the project once a container is restarted or corrupted? Should I use devcontainer or docker without devcontainer? What are the advantages and disadvantages to use devcontainer?
6 Replies
Codercord
Codercord5mo ago
Codercord
Codercord5mo ago
<#1376841804795740180>
Category
Help needed
Product
N/A
Platform
N/A
Logs
Please post any relevant logs/error messages.
What product are you using?
Phorcys
Phorcys5mo ago
hey @Joerg -- i'll get back to you later on with more details but here are some resources/infos to get started: - DevContainer integration is done through envbuilder (old way, how the Docker Devcontainer template works atm) or our new DevContainer support in Early Access -> https://coder.com/docs/admin/templates/extending-templates/devcontainers - DevContainer features library -> https://containers.dev/features DevContainers are a way to build Docker images from a JSON file in an easier way with access to a wide library of tools
My projects are stored in GitHub/GitLab. That means that all Astro projects in the Astro Template and all LaTeX Projects in a LaTeX Template?
Either this, or you can set up a devcontainer spec on a per-project basis if their stack differs, usually you do an Astro Template and a LaTeX one
How do I back up the project once a container is restarted or corrupted?
The home directory is persisted via a volume, regarding corruption, either you have backups of your container infra or you had pushed it to Git
Joerg
JoergOP5mo ago
Thank you for the answer. I installed this template. It works fine. What is the right way. Should I create a devcontainer repo in GitHub und than git clone https://github.com/user/devcontaner-astro ? Or should I create the devcontainer-astro package in the template and than push it to GitHub. How do I create a devcontainer-astro repo for Coder? I do not understand the right way to build and use a devcontainer in Coder.
No description
Phorcys
Phorcys5mo ago
Hi, sorry for the delay.
Should I create a devcontainer repo in GitHub und than git clone https://github.com/user/devcontaner-astro ? Or should I create the devcontainer-astro package in the template and than push it to GitHub
You'll have to create the repo and push the first devcontainer spec, you can do this anywhere and there's no right or wrong way. You'll only have to create a new workspace and give it that new repo's URL as the source so it uses that devcontainer.
How do I create a devcontainer-astro repo for Coder? I do not understand the right way to build and use a devcontainer in Coder.
Coder doesn't handle it much differently than other products do, so i'll give you the generic devcontainer how-to. You will first want to create a GitHub repo, or reuse the repo from your project. Then create a .devcontainer folder with a devcontainer.json spec in it. You can generate one from VSCode via the command palette. Then just create a new workspace from your template with that repo's URL, and Coder should be building the devcontainer from that repo.
ztlod ツ
ztlod ツ2w ago
Just a random question, @Phorcys, i've already a stable template that uses claude_code coder module, it will works seamlessly with the running devcontainer or i'll need to config something?

Did you find this page helpful?