First setup issues
Hi!
Im trying to install docker-code-server on Coder
but it quit on template import provision for start: recv import provision: plan terraform: terraform plan: exit status 1
https://paste.bijsven.nl/hofuzavuya.cpp
352 Replies
yeah so
can you send over your docker-compose.yml ?
you have to set the
user
value to coder:998
inside the service declaration
where 998 is the GID of the docker
grouphttps://paste.bijsven.nl/osujovocul.bash
I think so
actually, i didn't know about group_add
hmm
you should maybe try upping the compose version
oh
yeah i didn't know about group_add because it doesn't exist anymore it seems
oh
i followed the tutorial on the website
with gitclone
Docker - Coder v2 Docs
Install Coder with Docker / docker-compose
try with this
https://paste.bijsven.nl/sojeyifepa.http
yup
Get this error
That i need to use another version
That did i in the config
yeah it's 3.8 sorry
not 3.9
also your docker-compose is outdated
Again
oh
Just apt update && apt upgrade -y?
Im not that good in Docker π
no the package changed actually
I think it'd be
not sure about the remove part
and the newer command is
docker compose
without the -ah
yeah they decided to make it a plugin
Docker-compose is better π
https://paste.bijsven.nl/axenavafoy.rb
well you can alias it i guess
took me a bit to update my muscle memory
It didn't work
I have updated my rep.
ubuntu or debian?
Ubuntu Server 20.04 LTS
https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
you might have to do that
unsure
whatever
it's not really the point here
this one should work -> https://paste.bijsven.nl/ecuwesefit.http
Didn't work
same error ?
Yep
yeaaah so you'll want to update your compose
it's weird that it's not in the repo though
does
/etc/apt/sources.list.d/docker.list
exist on your system ?Yeah it does
Data:
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable
https://paste.bijsven.nl/suvamesufa.sqlyou tried apt update yeah ?
i mean it's' in the repo sooo
Soo?
it doesn't make sense
Docker Documentation
Install the Compose plugin
Download and install Docker Compose on Linux with this step-by-step handbook. This plugin can be installed manually or by using a repository.
Docker Compose version v2.16.0
Installed
Deamon has stopped?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
what's outputting that ?
you should now be able to use
docker compose up -d
Done that
nevermind
yeah
but then i get that
systemctl status docker
?i don't really know
hold on
is that the same server ?
What do you mean "Same Server"
yeah it is
Yeah i got plenty of Docker Containers
i thought i saw another hostname
Ohh
no
its @web
this genuinely doesn't make much sense
I know...
what does
docker info
output ?yeah no
systemctl restart docker
this'll kill all your containers thoughNo Prolbem
Only 5 people that are getting angry π€£
But i have a warning on the line for today
Done
try
docker info
again nowroot@web:/home/vs.bijsven.nl# docker info
Client:
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc., v2.16.0)
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
Paste server is also down π
docker version
?root@web:/home/vs.bijsven.nl# docker version
Client:
Version: 20.10.12
API version: 1.41
Go version: go1.16.2
Git commit: 20.10.12-0ubuntu2~20.04.1
Built: Wed Apr 6 02:14:38 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
a bit out of date aswell but that shouldn't be it
journalctl -xe -u docker
One sec
somethings arent starting up
rage quit time
A
The docker deamon
root@web:/home/vs.bijsven.nl# dockerd
INFO[2023-02-18T13:36:31.630053036+01:00] Starting up
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
well yeah it isn't running properly that's clear
it's likely running in the background still
since systemd managed the pidfile it's not deleted
what's this UI ? i'm not familiar with this
Portainer
root@web:/home/vs.bijsven.nl# /run/docker.sock
-bash: /run/docker.sock: Permission denied
i don't know
it shouldn't have caused that
i think maybe update your docker, maybe the compose plugin is failing to load ?
no error logs though soo
this is so weird
Yeah
Maybe i should first do this on my test server π
i dunno, it really shouldn't be doing that
Should it make any diffrents when i try to delete that?
I have fix it!
Its working now!
you can try doing
systemctl stop docker
and try running the docker daemon like you did
what fixed it?I have stopped Docker and docker.socket
Docker is up and running
alright
is your coder deployment running on a domain?
I want to set it on dev.bijsven.nl
bijsven means bysven its dutch :D
you'll want to edit (or create) the
.env
file in the same folder as the compose file
and add CODER_ACCESS_URL=https://mydomain.tld
I want to use it with a reversed proxy (nginx proxy manager) does that make a diffrents?
no that's fine
access URL is the URL it's going to be accessed from
so coder doesn't care if it's being reverse proxied as long as it's accessible from the given url
yup
And now i should can create a workspace?
Template
don't you already have a template?
anyways yeah
nope
you can
https://paste.bijsven.nl/qayipoteho.cpp
nope
Same error as the start
can you send your docker compose again?
what's the output of
id -g docker
?nevermind wrong command
getent group docker
docker:x:119:root
lol that's why
change coder:998 to coder:119
in the yaml?
yup
restart the container?
rerun
docker compose up -d
everytime you change the compose file yeahYeah
180 messages π
does it work?
Yeah, one more question
When i press this button
Its shows white
can you show me the URL?
it should work
try to open devtools (ctrl+shift+i), navigate to the network tab and hit ctrl+r
oh
it was taking super long before it loaded
but it does load π
And how do you add people to a workspace?
i'll let someone else answer since i have never needed to do that
cc: @Atif
long time no see atif's profile picture
And do you know how to see your HTML CSS JS code
on web based view?
sorry?
you're editing a static site and want to see it?
Yeah
like i want to try out my code
But how do you view the output of the code
like a website
you either want to have a web server running like caddy and define a coder_app for it
or what i recommend is setting up port forwarding with a wildcard domain and booting a temporary web server on demand
Is there any documentatin for wildcard
yes there is, let me find it
thx
what do you use to generate tls certs?
SSL certificates?
it's called TLS now but yeah
well, TLS is SSL's successor
Okay
I don't know if i have it
The page where coder is located is ssl
with Nginx Proxy Manager
here are the docs
https://coder.com/docs/v2/latest/admin/configure#wildcard-access-url
Configuration - Coder v2 Docs
Learn how to configure Coder
okay, have you ever sat up wildcard hosts before?
Nope
what's your nameservers? (cloudflare, porkbun, google domains, etc)
Cloudflare
alright
I found this about setting up wildcard
https://www.reddit.com/r/unRAID/comments/kniuok/howto_add_a_wildcard_certificate_in_nginx_proxy
reddit
r/unRAID - HOWTO: Add a wildcard certificate in Nginx Proxy Manager...
138 votes and 45 comments so far on Reddit
i'm not too familiar with nginx proxy manager, I use Caddy which is simple and fetches certificates for you automagically
I know how it works i think
i have working it with 29 other proxy hosts
basically your certificates come from let's encrypt
usual certificate challenges work by hosting a file on a http server
but wildcard requires a different challenge type which is DNS, because it can allow to serve on any subdomain
actually
you'll want your wildcard to be *.dev.yourdomain
i think your coder is exposed on the dev subdomain right?
Yeah
alright yeah
do i need to set the SSL to *.dev.bijsven.nl?
yes
and then have nginx proxy manager reverse proxy *.dev.bijsven.nl to your coder IP
Okay
I need to create an cloudflare api token
yup
like with caddy
just set "modify dns" permission for specific zone and select your domain
oh
like you did but just set the host
i didn't read further then my nouse if long
(i dont know if that is a word in english)
(i just translated with my tiny brain π )
wdym?
I didn't look longer than my nose is long
i understand reading futher than your nose since that exists in french too
π
Yeah my english is not good
oh yeah your way of saying it is just longer
coder now publishes docs on setting up a wildcard domain with TLS. Let me grab the link
i did send it
here
but i don't think it has instructions for nginx proxy manager
yeah it doesn't
alright i'll be gone for a bit, i have to return something at a store
Now i think that its working
I have followed the hole guide
yeah
its working π
Configuration - Coder v2 Docs
Learn how to configure Coder
Whats the next step?
It has now for apache, ngnix and caddy
Please follow one of the guides.
This one?
This
I have a wildcard tls
now
Everything should work then
What should work?
okay so
now you should set
CODER_WILDCARD_ACCESS_URL=https://*.dev.bijsven.nl
in your .env
that's something else, you're trying to run the coder server on your own computeroh oky
And then?
Restarting the container...
yeh
then from the web UI, you should be able to use the "port forward" button on your workspace's page
how did you restart the container?
what command did you use i mean
docker compose stop && docker compose start
no
you should use
down
and up
instead of thoseokay
and also running
docker compose up -d
automatically recreates modified containers
without needed to run down
Okay!
Done!
AFAIK stop and start are deprecated and only restart the container without taking in account config changes
that's odd..
let me look at my config
Okay!
i think you also need to enable wildcard
What do you mean?
In Nginx Proxy Manager or Coder?
coder, but i'm wrong
oh, my bad!
?
it's this but without the https
aah
thx
@Ben maybe this should be named CODER_WILDCARD_ACCESS_DOMAIN?
to prevent from confusion
Restarted...
wtf lol
can you show me your env file once again
oooh no
without https:// altogether
like just *.dev.bijsven.nl
sorry for not making that clear lol
oh
np
Like this
?
nah
aah
it's called URL but it doesn't make sense since it's only the domain
that's what I pinged ben about
yup
π
then all should work
shoot it
can you run
docker logs coder
for me ?Error: No such container: coder
I should look at Portainer
yeah
My internet is very slow.
Im sorry
I takes so long
you're fine
π
vsbijsvennl-coder-1
PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-02-18 15:44:19.263 UTC [1] LOG: starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-02-18 15:44:19.264 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-02-18 15:44:19.265 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-02-18 15:44:19.269 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-02-18 15:44:19.288 UTC [25] LOG: database system was shut down at 2023-02-18 15:44:14 UTC
2023-02-18 15:44:19.298 UTC [1] LOG: database system is ready to accept connections
database
i only needed coder for that but thx
π
i don't know honestly
hm
did you use
docker compose up
?Yep
docker compose up -d
yeah
root@web:/home/vs.bijsven.nl# docker compose up -d
[+] Running 2/2
β Ώ Container vsbijsvennl-database-1 Healthy 0.7s
β Ώ Container vsbijsvennl-coder-1 Started 1.4s
maybe it needs you to setup
CODER_ADDRESS=0.0.0.0:7080
replace 7080 with your port
actually7080
maybe try restarting the workspace first
is the port
Okay
maybe that's the reason
And then also the Coder?
133 seconds remaining...
done
if restarting the workspace doesn't work edit the config and restart coder
With config?
When i click on the container
its says "Unable to connect"
Which config?
.env
Okay
But what do i need to edit then?
try adding this line @Sven
Okay!
Done
but now?
try to restart but I've got no clue if it has an impact
i'll leave this to another member of the server because I don't think I can help
@Atif can you help?
Can you do something with this log?
vsbijsvennl-coder-1 | WARN: --address and -a are deprecated, please use --http-address and --tls-address insteadStarted HTTP listener at http://0.0.0.0:7080
it doesn't matter much, I think it's related to the docker container itself (I have it too)
oh okay, and who can i the best contact for this?
Is there some expert on the Docker side of Coder?
oh no like i meant it's not the root cause of your issue
Ah, in #ποΈ±releases comes the updates. Do you think there is in a feature release a update that fix it?
here's my config
coder.env
docker-compose.yml
And that doesn't work of does work?
it does work
oh
Lets try it π
you should try only adding CODER_EXPERIMENTAL=true i guess because that's the only thing changed
but it shouldn't need that, i am honestly confused by this
it's likely just in front of us too
Does it make a diffrents when you have enter's between your text?
nah
π
And port 80
Does that make a diffrents?
not either
and here are my logs
we basically have the same setup
except some network-related differences but that can't be the cause of it
Maybe when we changed the PI to 119
in the docker-compose.yaml
nope
because the port forward feature doesn't require docker to work
And you have used 3.9
otherwise your workspace wouldn't boot at all
docker version
yeah your right
yeah no that's the same thing
okay
what's your coder version ?
actually !!
can you show me this page?
https://dev.bijsven.nl/settings/deployment/network
okay, now the general tab please
HAH
lol i can't with this
?
uuuh...
it was that simple
THAT SIMPLE really
????
CODER_WILDCARD_ACCESS_URL
is wrong?!
whats wrong?
sorry it's just very funny
it was right there all that time
Thats what i have now
aggghhhhhh.....
coder still doesn't know about it though clearly
oh my god
it's my fault
entirely my fault
i'm so so dumb
No your aren't
rename that
.env
to coder.env
What i send in dm π
and
and?
can you send your compose file again
you need to get rid of the
block
and replace it with
oh my god i really hate myself
all that time the variables just weren't being passed to the container
can you wrap it in a codeblock next time pls
here you go
copy paste?
yeah
you'll want your files to be :
.env
coder.env
yeah
oh man this is such a simple mistake
yeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
Set it on the website
so much time wasted
Haha
I have a free dayh
its just no problem π
you should have that one now
Yeah
and then?
yeah so
do you know how to start up a dev server ?
you can use a command like
python3 -m http.server
in the directory that contains the html files
then use the port-forward feature to access the http serverah
okay
Terminal --
(given you have python3 installed)
Im doing a fresh reinstall π
1 sec
Is this good?
yup
then you can access 8000 from the port forward button
https://8000--main--Workspace-Sven--Sven.dev.bijsven.nl doesn't work π¦
It is a HTML file
what does it show ?
Dutch: Firefox Error Page
html file: https://paste.bijsven.nl/ujiweyezew.xml
oh yeah
you're missing a DNS record maybe
hold on
yup
you'll want to create an A record in your cloudflare UI
*.dev.bijsven.nl
and make it point to your ip*.dev.bijsven.nl
right?
yeah
Saved!
Same error
Or it taking a while before it update
nah, you need to configure nginx proxy manager too
so that it reverse proxies *.dev.bijsven.nl to coder
π
should work now
Nope
Its intressting...
show me
This give
404 not found
https://6060--main--workspace-sven--sven.dev.bijsven.nl/
but the python3 page
Just refused
so it works
add /index.html at the end
maybe
on port 6060
atleast your port-forward works now
i'm going to bed
Sleep well!
ty
Its working now....
Everthing is working!
Now only how to add users to workspaces and im done!
When you have apache2 and the editor on /var/www/html its perfect!
And when your restart a workspace
its resets the apt-installs you have done
Like Apache is gone
@Sven honestly, reading this thread you really need to learn how images and containers work if you don't want to have to ask questions all the time.
For example the reason everything is gone is because by default containers don't save anything added to them. You need to add a "volume"
I don't mean to be rude, if this is back and forth works for you that's great, but otherwise I'd look at a video like this;
Tech With Tim
YouTube
An Introduction To Docker For Beginners
Welcome back to another video! In this video I am going to be giving you an introduction to Docker and more specifically talk about the difference between Docker and virtual machines! The first part of this video is going to be very face paced where I just explain the fundamentals of Docker and then I will head over to the computer and do a walk...
Although to give props where props are due, I'm impressed you got through the process without knowing about docker π«
But Coder is like a docker-container host right?
alright so
yes! because docker containers are non-persistant, by default, the docker-code-server template has a docker volume for /home/coder.
a docker volume is basically a folder mount managed by docker (it ends up in
/var/lib/docker/volumes
basically, nothing will persist if you don't have a volume mounted at some specific directories
but, I don't recommend persisting APT packages, that takes way too much space.
so, what you want to do is edit the Dockerfile to install apache2 (and maybe configure it a bit) for youCan you just have a template that automaticly have Apache2 installed?!
Coder relies on terraform, docker is only one of the providers.
think of docker as a "runtime" for your workspaces, you could have those be pretty much anything (a proxmox VM, a google cloud/aws VPS, etc)
of course
yeah!
Is there any documentation for creating those templates?
you're using docker-code-server right?
Yeah docker-compose
templates running on AWS, etc?
no like the template you use
code-server
"Starters Templates" > "Develop code-server in Docker"
yeah
That do i use
do you have the template on your computer?
Nope, how do you download/make that?
alright
do you have the coder cli installed on your workstation
I don't think so
windows?
Yeah, my VPS is on Ubuntu Server and my laptop on Windows 11 latest build
Windows - Coder v2 Docs
Install Coder on Windows
just the first 2 steps should be okay
then run
coder login https://dev.bijsven.nl
and coder templates pull docker-code-server template.tar
and extract that tar with 7zip or whateverResource not found or you don't have access to it
(Im am going to eat. brb)
to what command?
coder templates pull docker-code-server template.tar
But now i am away π
maybe it's not named that then
ooooh -- you have a space in your template name
not sure how that's gonna go
coder templates pull "Code Server" template.tar
edit: this is only the display name so it couldn't workSame error
what does
coder templates list
output ?code-server Feb. 18 2023 1 active dev.
yeah then it's
coder templates pull code-server template.tar
Got m
Does this release also keep apache2 etc.?
what?
i'm making you pull the template so you can edit it
oh im sorry
i won't be available for a bit but you should look into using a dockerfile with your template
there's a template for that and you can look at kreuzwerker/docker docs
π
Can you set RAM and CPU limits on a Workspace?
And can you connect Coder to a other server
like Back-end --> Viewer --> Proxy --> Web
yes, look at kreuzwerker/docker docs
you declare those limits in the docker_container
what do you mean
nevermind
yes when we use different templates, e.g aws template is actually connecting your aws hosted workspace to Coder. Similar for other cloud providers
π and this:
make sure you are logged in
coder login
and also, verify if the name of template is correctIm logged in
@Sven can you create a new issue instead please?
I don't really like mixing issues together, it makes stuff less understandable
Im sorry! π¦
please.. not in this channel