how to install docker in aws ec2 (devcontainer) template?
after I created a new workspace based on the default aws ec2 (devcontainer) template,
in the vscode > terminal , I tried the following command to install docker, but I could not find my password for coder, pls help
$sudo apt install docker
[sudo] password for coder
23 Replies
<#1269319437228441683>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
error log:
🐳 envbuilder-starter-devcontainer # docker
bash: docker: command not found
🐳 envbuilder-starter-devcontainer # apt install docker
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
🐳 envbuilder-starter-devcontainer # sudo !!
sudo apt install docker
[sudo] password for coder:
hello, do you control the devcontainer file ?
I am sorry, how can I control the devcontainer file ? I have the admin role
where can I find the devcontainer file?
i meant it as in, do you control the repository where the devcontainer file is contained?
what repo are you using in your template?
I am using the default template (unchanged)
data "coder_parameter" "repo_url" {
name = "repo_url"
display_name = "Repository URL"
default = "https://github.com/coder/envbuilder-starter-devcontainer"
description = "Repository URL"
mutable = true
}
do I need to clone the "https://github.com/coder/envbuilder-starter-devcontainer" repo?
do I need to folk the repo "https://github.com/coder/envbuilder-starter-devcontainer" to my personal github?
well, it depends
what are you trying to achieve?
devcontainers are usually used when you want a template per project, it doesn't seem that this is your case?
1 . I used the AWS EC2 devcontainer template to create a workspace
2. in my newly created workspace, it showed that I do not have docker installed.
3. then I tried $sudo apt install docker
4. but it prompted me for password of user coder -> I do not know the password
what is the password for user coder?
pls help
I meant that devcontainers might not be the right tool for the job in your use-case
if you want to have a different environment per project then they make sense
but if you want a generic environment to use accross projects then maybe use the docker templates or similar
try "coder" or an empty password
but this isn't really the solution to your problem, your template should allow for passwordless sudo, i think this issue is due to the fact that you're not really supposed to use the envbuilder-starter-devcontainer image since it's more of an example
if you install Docker, it will not be persisted
if you do want to use Devcontainers, you will want to incorporate it into the devcontainer image using the
docker-in-docker
devcontainer featuremy objective: I would like to start a coder workspace and immediately, I have got the environment setup based on this .NET devcontainer template. how can I do it? pls advise https://github.com/devcontainers/templates/tree/main/src/dotnet
GitHub
templates/src/dotnet at main · devcontainers/templates
Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own! - devcontainers/templates
alright
so you'll want to create a repo that has a devcontainer spec based on that template and edit the template to use that repo instead
hey @Manchi L. -- any luck?
no, still no success.
I would like to start a coder workspace using the devcontainer for dotnet, with all the dotnet tooling installed on Ubuntu arm64.
We will soon be updating our aws-devcontainer template with docker in workspace working.
how can I get the new template? do I need to reinstall the coder server?
the new template is not out yet
and you wouldn't need to reinstall/update Coder to install it
quick question, do you want to run the .NET devcontainer in your workspace (like you would do with desktop VS Code) or do you want your workspace to be based on that .NET devcontainer?
I would like to test both and evaluate the pros and cons too
alright so I would advise that you create a repository where you apply this template to test it out
then look for your .NET template and add it
then feed that repo to Coder when using the AWS EC2 devcontainer template
sorry! I totally missed your first messages
so basically this starter repo is not really meant to be used in your workspaces but mostly as a starting point
it does not have passwordless
sudo
configured for the coder
user and the coder
user has no password so basically you can't really elevate to root
hi @Manchi L., any luck?I have given up on this. Perhaps, I do not understand the idea of docker in a docker fully. I may do further research and post a new question if necessary. thanks for much for checking in!
alright, sorry that we weren't able to help :(
@Phorcys closed the thread.