Skip to content

Sample Clojure devcontainer configurations (including Kubernetes) for VSCode and Github codespaces.

Notifications You must be signed in to change notification settings

jwhitlark/cnc-devcontainer-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cnc-devcontainer-templates

A quick note for non-VSCode users.

After 20+ years of emacs, I switched to VSCode for various reasons. While these setups are tailor-made for VSCode, both Devcontainers and Github Codespaces have both remote and local solutions for other editors. I encourage you to search around for solutions to make it work for your preferred setup.

This issue tracks using emacs with devcontainers.

Templates

Codespace Type Link
Single Image (default): Open in Github Codespaces Single Image
Docker Compose: Open in GitHub Codespaces Docker Compose
Kubernetes (k3s via k3d) Open in GitHub Codespaces Kubernetes (k3s via k3d)

When would you use these?

Single Image

Quick experiments, Simple tools, or projects with Sass only dependencies.

Docker Compose

Simple setups, or projects with multiple local dependencies that are not intended to deployed to Kubernetes in production.

Kubernetes

You're going full Cloud Native Clojure, and want to dev as you prod!

Common to all templates

All include

  • clojure 1.11 (1.12 is going to be awesome!)
  • babashka
  • tools-deps
  • lein
  • clj-new
  • deps-new

VSCode liveshare

All these examples are fully compatible with VSCode liveshare, which is one of the killer features of this platform. Being able to work together on on code without setting up an additional environment while using your preferred editor settings is a delight.

Finding, getting info, and installing additional packages

apt update
apt search XYZ
apt show XYZ
apt install XYZ

Accessing Private JARs

See Managing Access to other Repositories

Github actions, issues, etc.

Minimal VSCode setup

If you don't use vscode, I recommend setting up a minimal profile that emulates your favorite editor, and turning on settings sync. That way you will always have a minimally functional editor when you use a codespace.

Note that you can configure your preference between the web editor, local VSCode, and other editors.

You will need to specifically allow your repositories to access your shared configuration.

Configure both of these and more at Your codespace settings

Dotfiles

You can specify a dotfile repository, that will be injected into your devcontainer.

Docs

Configure at Your codespace settings

Prebuilds

Github actions can be automatically setup to pre-build your devcontainer docker images, dramatically speeding up startup.

https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds

Differences between devcontainers on your local machine and Github Codespaces

Setting a minimum machine specification

codespaces - minimum machine settings

Single container specifics

Docker compose specifics

Kubernetes specifics

Includes

Shell tools

Clojure dependencies

K3d commands

k3d cluster create

k3d cluster create --registry-create myregistry  > k3d.log 2>&1

k3d cluster list

k3d cluster start

Add the following to auto deploy manifests?

--volume /tmp/test-manifests:/var/lib/rancher/k3s/server/manifests/test

About

Sample Clojure devcontainer configurations (including Kubernetes) for VSCode and Github codespaces.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published