code-server image that allows setup of development environment as normal user using nix commands.
510
This barebones code-server image includes the core nix commands. This allows any package to be installed through nix-env or other nix commands.
docker composeA minimal compose.yml file to start the code-server container:
services:
code-server:
image: haskelious/code-server:latest
environment:
- PASSWORD=changeme
ports:
- "8080:8080"
restart: unless-stopped
run this with docker compose up and open a browser to http://localhost:8080 using the password changeme when asked.
Add the following to compose.yml to ensure data persistence:
services:
code-server:
image: haskelious/code-server:latest
[...]
volumes:
- code-server:/home/nix
volumes:
code-server:
To avoid the invalid certificate warning from the browser, you need to use a proper signed certificate.
Create a ./certs folder next to the compose.yml file, and store the certificate into cert.pem and the private key into key.pem in that folder.
Add the following to compose.yml to use the trusted certificate with HTTPS:
services:
code-server:
image: haskelious/code-server:latest
[...]
environment:
- HTTPS=true
- CERT=/certs/cert.pem
- CERTKEY=/certs/key.pem
- PORT=8443
ports:
- "8443:8443"
volumes:
- ./certs:/certs
You can add more settings through the environment variables in the compose.yml file:
- PASSWORD=changeme
- HTTPS=true
- HOST=myhost.exanple.com
- CERT=/certs/cert.pem
- CERTKEY=/certs/key.pem
- PORT=8443
- INSECURE=false
You can set up a development environment by installing development tools (python, rust, go, ...).
Some examples are provided in scripts located in the /envs/ folder.
To install rust and related tools, use /envs/import_rust.sh
Within the container, you can install any package from nixpkgs, for example the gdb package, by using a command similar to
nix-env -f channel:nixpkgs-unstable -iA gdb
In order to enter a shell with commands available for you to use within this shell session, for example a python interpreter, use
nix-shell -p python3
Content type
Image
Digest
sha256:59a795e82…
Size
252.4 MB
Last updated
8 months ago
docker pull haskelious/code-server