-
Notifications
You must be signed in to change notification settings - Fork 4
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
Base clojure template #19
Changes from all commits
9c96951
e9663a0
fb6fb18
8cab3b9
9d0a018
a1b6326
ddec359
164c789
d0d30b9
451edf3
f3afa2d
19246dd
557a747
db90f87
8d78577
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM clojure:${templateOption:imageTag} | ||
|
||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create the user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
# | ||
# [Optional] Add sudo support. Omit if you don't need to install software after connecting. | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
|
||
# [Optional] Set the default user. Omit if you want to keep the default as root. | ||
USER $USERNAME | ||
SHELL ["/bin/bash", "-ec"] | ||
ENTRYPOINT ["bash"] | ||
|
||
|
||
# Prepare clojure tools | ||
RUN clojure -Ttools list && \ | ||
clojure -Ttools install io.github.seancorfield/clj-new '{:git/tag "v1.2.404" :git/sha "d4a6508"}' :as clj-new && \ | ||
clojure -Ttools install-latest :lib io.github.seancorfield/deps-new :as new && \ | ||
clojure -Ttools list | ||
|
||
RUN sudo apt-get update && \ | ||
sudo apt-get install -y lsb-release |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/scicloj/devcontainer-templates/tree/main/src/basecloj | ||
{ | ||
"name": "Base clojure dev env", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"USERNAME": "${localEnv:USER}" | ||
} | ||
}, | ||
"remoteUser": "${localEnv:USER}", | ||
"containerUser": "${localEnv:USER}", | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"betterthantomorrow.calva" | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
|
||
## Options | ||
|
||
| Options Id | Description | Type | Default Value | | ||
|-----|-----|-----|-----| | ||
|
||
>Note: comming soon | ||
|
||
# A minimal devcontainer with JAVA, Clojure and minimal clj tools | ||
|
||
It sets up a minimal dev container environment with green fields minimal tools for Clojure. | ||
|
||
# Quickstart | ||
|
||
0. Install [devcontainer cli](https://github.com/devcontainers/cli) | ||
1. Run `devcontainer templates apply -t ghcr.io/scicloj/devcontainer-templates/basecloj` to create a devcontainer setup | ||
with default settings in your current directoty | ||
2. Open folder with VSCode / devcontainer / devpod / Codespaces and trigger/wait for container build | ||
3. [Start the Calva repl](https://calva.io/getting-started/) | ||
|
||
|
||
4. Create a new app, lib, template and more: | ||
* Read [deps-new](https://github.com/seancorfield/deps-new) | ||
* Read [clj-new docs](https://github.com/seancorfield/clj-new) | ||
|
||
## Customization | ||
5. Install more features in devcontainer: https://containers.dev/features | ||
|
||
--- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"id": "basecloj", | ||
"version": "1.0.0", | ||
"name": "Base clojure development environment", | ||
"description": "A devcontainer template with the minimum clojure tools and configuration, this template is intended to create new greenfield clojure project that should be further customised on specific project needs. ", | ||
"documentationURL": "https://github.com/scicloj/devcontainer-templates/tree/main/src/basecloj", | ||
"licenseURL": "https://github.com/scicloj/devcontainer-templates/blob/main/LICENSE", | ||
"options": { | ||
"imageTag": { | ||
"type": "string", | ||
"description": "Tag of official Clojure image", | ||
"proposals": [ | ||
"temurin-8-tools-deps-jammy", | ||
"temurin-11-tools-deps-jammy", | ||
"temurin-17-tools-deps-jammy", | ||
"temurin-21-tools-deps-jammy" | ||
], | ||
"default": "temurin-21-tools-deps-jammy" | ||
} | ||
}, | ||
"platforms": [ | ||
"Any" | ||
] | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
cd $(dirname "$0") | ||
source test-utils.sh | ||
|
||
# Template specific tests | ||
check "distro" lsb_release -a | ||
check "java_jdk" java --version | ||
check "clojure" clojure --version | ||
check "clj" clj --version | ||
check "user" id | ||
|
||
# Report result | ||
reportResults |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried as well to make "bash" the defaut shell, but did not succeed neither.When I open a "terminal" in VSCode, I get "sh" first and not "bash".
If you are aware of a way to get a "bash" by default, let me know.