Coder2 + some little features:
- fixuid
- Easy SSL setup, kind of
SSH agent forwarding (only when it runs from terminal, and if the session is still alive)- Pass your SSH keys to the container
- Pass your Git configs to the container
To build and start Coder, run bash up
. (If you have not got a SSL certificate yet, check the section below before)
$ git clone https://github.com/cognitom/coder2-docker.git
$ cd coder2-docker
Set your own domain name for Coder and your password for authentification:
$ echo "export CODER_HOST='example.com'" >> ~/.bashrc
$ echo "export CODER_PASS='your-perfect-strong-password'" >> ~/.bashrc
$ echo "export CODER_PORT=8080" >> ~/.bashrc
$ source ~/.bashrc
Then, run:
$ bash up
Open http://example.com:8080 on your brwoser.
Let's get your certificate from Let's Encrypt. lego is exactly the tool for that.
You don't even need to install it. Just run lego
via Docker:
$ docker run -it -v "${HOME}/.lego:/.lego" goacme/lego \
--email="yourname@example.com" \
--domains=$CODER_HOST \
--dns=manual \
run
I chose the manual method (--dns=manual
) in the example command above, but there're many many options. Check it out here: https://go-acme.github.io/lego/dns/
Ready? Run bash up
again, and open https://example.com:8080 on your brwoser.
Before commiting, you need to tell Git your name and email (if you haven't set them yet):
$ git config --global user.name "John Doh"
$ git config --global user.email "john.doh@example.com"
Then, your .gitconfig
will be shared with the Coder container.