Skip to content

initial setup of devcontainer #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM clojure:temurin-20-tools-deps-jammy
# Details as of 2023-09-19:
# Ubuntu: Ubuntu 22.04 LTS (Jammy Jellyfish)
# JDK: eclipse-temurin 20
# Clojure: tools-deps, 1.11.1.1347

# Extra tools
RUN apt-get update && apt-get install -y gpg curl

# Install new and clj-new (prefer new, but clj-new is needed for some templates)

RUN clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new
RUN clojure -Ttools install-latest :lib com.github.seancorfield/clj-new :as clj-new

# Add Babashka

RUN curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install \
&& chmod +x install \
&& ./install --static
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Clojure kit tutorial",
"build": {
"dockerfile": "Dockerfile.dev"
},
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// More info: https://containers.dev/features.
"features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Run commands on cluster first start. Useful for download dependencies, etc.
// "postCreateCommand": "",
// Copy host env vars into the devcontainer. You can also refer to some_file.env files in your docker or docker-compose setup.
"remoteEnv": {},
"customizations": {
"vscode": {
"extensions": [
"betterthantomorrow.calva"
]
}
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
*.iml
*/.DS_Store
target/

# Devcontainer ignores
.clj-kondo/*
.lsp/*
# Tutorial project, comment out if you want to save your work.
guestbook/*
9 changes: 9 additions & 0 deletions resources/md/guestbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ project architecture.

If you don't have a preferred Clojure editor already, then it's recommended that you use [Calva](https://calva.io/getting-started/) to follow along with this tutorial.

## Quickstart via Devcontainers or Github Codespaces
If you have configured your Github account, you can start the project without any other setup. It will open a web-based vscode editor backed by a Github Codespace VM. (Codespaces is Github's hosted Devcontainer solution)

[![Open in Github Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/jwhitlark/kit-clj.github.io)

You can also clone this repo locally, and using vscode (with the devcontainer plugin), and Docker Desktop, run an isolated, fully setup version of this application locally. Open the repo in your editor and run the command `Dev Containers: Open Folder in Container...`.

Once you're running in a devcontainer, open a terminal and jump to [Creating a new application](#creating-a-new-application)

### Installing JDK

Clojure runs on the JVM and requires a copy of JDK to be installed. If you don't
Expand Down