Coder CLI in docker

Hi, how i can create first template when I'm using coder oss in docker? Inside the docker I can't, this same in system (ubuntu).
26 Replies
maf
maf3y ago
The Quickstart instructions are here, should help you get started: https://coder.com/docs/coder-oss/latest/quickstart
Quickstart - Coder OSS main docs
Create your first template and workspace
Mopsior
MopsiorOP3y ago
i put everything in docker (docker-compose) and i dont have cli in my machine. In quickstart i need to run commands, but i cant. When i'm in docker i have logs stream
maf
maf3y ago
You can install the Coder CLI on your machine e.g. via the install script: https://coder.com/docs/coder-oss/latest/install/install.sh
Install script - Coder OSS main docs
One-line install script for macOS and Linux.
Mopsior
MopsiorOP3y ago
i need it when i using docker?
maf
maf3y ago
Are you not planning on using e.g. SSH to SSH into workspaces later on?
Mopsior
MopsiorOP3y ago
no
maf
maf3y ago
Ok, well you could just exec into your Docker container and run the coder commands from there.
Mopsior
MopsiorOP3y ago
oh wait, did it will allow me to use terminal in vsc?
maf
maf3y ago
Depends if you're using VSCode or code-server in browser. For VSCode with remote extensions you'll need the coder binary.
Mopsior
MopsiorOP3y ago
i want to use code-server for it
maf
maf3y ago
It has a built-in terminal you can use. You can also use the separate Web Terminal (available in Coder webUI).
Mopsior
MopsiorOP3y ago
okay, i have a other question, because i dont know if i do it right. Does coder oss is something like "manager to code-server"?
maf
maf3y ago
Nah, running code-server is just something you can do with Coder OSS. The sky's the limit with regards to what else you can do (or rather, anything you can dream up to do in Terraform).
Mopsior
MopsiorOP3y ago
okay, so i think i'm want still oss
Mopsior
MopsiorOP3y ago
No description
maf
maf3y ago
You could open up a shell or give the full path (/opt/coder IIRC)
Mopsior
MopsiorOP3y ago
how i can open shell? /bin/bash dont work
Mopsior
MopsiorOP3y ago
if i do not detached i have logs stream
No description
Phorcys
Phorcys3y ago
you should just install coder on your personal machine and manage from there because it's probably not present are you using a reverse-proxy?
Mopsior
MopsiorOP3y ago
yes, nginx but now im connecting via ip and unlocked port Okay
maf
maf3y ago
/bin/sh is usually always present
Mopsior
MopsiorOP3y ago
No description
maf
maf3y ago
/opt/coder
Phorcys
Phorcys3y ago
remember to set CODER_ACCESS_URL to the external facing URL
Mopsior
MopsiorOP3y ago
/home/coder/docker $ /opt/coder login http://-:7080
Open the following in your browser:

http://-:7080/cli-auth

> Paste your token here:
> Welcome to Coder, Mopsior! You're authenticated.
/home/coder/docker $ /opt/coder templates create
> Create and upload "~/docker"? (yes/no)
✔ Queued [284ms]
✔ Setting up [57ms]
✔ Adding README.md... [57ms]
✔ Parsing template parameters [113ms]
⧗ Detecting persistent resources
Terraform 1.2.1
data.coder_workspace.me: Refreshing...
data.coder_provisioner.me: Refreshing...
data.coder_provisioner.me: Refresh complete after 0s [id=05ee3e6b-0e55-471a-a480-d2ca5f72cbb8]
data.coder_workspace.me: Refresh complete after 0s [id=a8fc2fee-dda9-47b3-94ad-4d0ce7197225]
Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied

✔ Detecting persistent resources [5472ms]
✘ Cleaning Up [107ms]
template import provision for start: recv import provision: plan terraform: terraform plan: exit status 1
Run 'coder templates create --help' for usage.
/home/coder/docker $ /opt/coder login http://-:7080
Open the following in your browser:

http://-:7080/cli-auth

> Paste your token here:
> Welcome to Coder, Mopsior! You're authenticated.
/home/coder/docker $ /opt/coder templates create
> Create and upload "~/docker"? (yes/no)
✔ Queued [284ms]
✔ Setting up [57ms]
✔ Adding README.md... [57ms]
✔ Parsing template parameters [113ms]
⧗ Detecting persistent resources
Terraform 1.2.1
data.coder_workspace.me: Refreshing...
data.coder_provisioner.me: Refreshing...
data.coder_provisioner.me: Refresh complete after 0s [id=05ee3e6b-0e55-471a-a480-d2ca5f72cbb8]
data.coder_workspace.me: Refresh complete after 0s [id=a8fc2fee-dda9-47b3-94ad-4d0ce7197225]
Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied

✔ Detecting persistent resources [5472ms]
✘ Cleaning Up [107ms]
template import provision for start: recv import provision: plan terraform: terraform plan: exit status 1
Run 'coder templates create --help' for usage.
I set coder_access_url to facing url, in command i use server ip but still dont work

Did you find this page helpful?