This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
172 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster | ||
ARG VARIANT=17 | ||
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} | ||
|
||
# [Optional] Clojure version | ||
ARG CLOJURE_VERSION=1.10.3 | ||
|
||
# [Optional] Clojure tools version | ||
ARG CLOJURE_CLI_VERSION=1.10.3.1075 | ||
|
||
# [Optional] Leiningen version | ||
ARG LEININGEN_VERSION="stable" | ||
|
||
# [Optional] POLYLITH version | ||
ARG POLYLITH_VERSION="0.2.13-alpha" | ||
|
||
# [Optional] Boot version | ||
ENV BOOT_VERSION=2.8.3 | ||
|
||
# [Optional] Clojure version used by Boot | ||
ENV BOOT_CLOJURE_VERSION=${CLOJURE_VERSION} | ||
|
||
# [Option] Install Clojure CLI tool | ||
ARG INSTALL_CLOJURE_CLI="true" | ||
|
||
# [Option] Install Boot | ||
ARG INSTALL_BOOT="true" | ||
|
||
# [Option] Install Leiningen | ||
ARG INSTALL_LEININGEN="true" | ||
|
||
# [Option] Install Polylith | ||
ARG INSTALL_POLYLITH="true" | ||
|
||
RUN if [ "${INSTALL_CLOJURE_CLI}" = "true" ]; then \ | ||
apt-get update \ | ||
&& apt-get -y install rlwrap \ | ||
&& curl -OL "https://download.clojure.org/install/linux-install-${CLOJURE_CLI_VERSION}.sh" \ | ||
&& chmod +x linux-install-${CLOJURE_CLI_VERSION}.sh \ | ||
&& /linux-install-${CLOJURE_CLI_VERSION}.sh \ | ||
&& rm /linux-install-${CLOJURE_CLI_VERSION}.sh \ | ||
&& su vscode -c "clj --version"; fi | ||
|
||
RUN if [ "${INSTALL_BOOT}" = "true" ]; then \ | ||
curl -OL "https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh" \ | ||
&& chmod +x boot.sh \ | ||
&& mv boot.sh /usr/local/sbin/boot \ | ||
&& su vscode -c "boot -u"; fi | ||
|
||
RUN if [ "${INSTALL_LEININGEN}" = "true" ]; then \ | ||
curl -OL "https://raw.githubusercontent.com/technomancy/leiningen/${LEININGEN_VERSION}/bin/lein" \ | ||
&& chmod +x lein \ | ||
&& mv lein /usr/local/sbin; fi | ||
|
||
# Cache Clojure and dependencies | ||
RUN if [ "${INSTALL_LEININGEN}" = "true" ]; then \ | ||
su vscode -c " cd ~ \ | ||
&& echo '(defproject dummy \"\" :dependencies [[org.clojure/clojure \"'${CLOJURE_VERSION}'\"]])' > project.clj \ | ||
&& lein deps \ | ||
&& rm project.clj"; fi | ||
|
||
RUN if [ "${INSTALL_POLYLITH}" = "true" ]; then \ | ||
curl -OL "https://github.com/polyfy/polylith/releases/download/v${POLYLITH_VERSION}/poly-${POLYLITH_VERSION}.jar" \ | ||
&& mkdir -p /usr/local/polylith \ | ||
&& mv poly-$POLYLITH_VERSION.jar /usr/local/polylith \ | ||
&& echo '#!/bin/sh\nARGS=""\nwhile [ "$1" != "" ] ; do\n ARGS="$ARGS $1"\n shift\ndone\nexec "java" $JVM_OPTS "-jar" "/usr/local/polylith/poly-'$POLYLITH_VERSION'.jar" $ARGS\n' > /usr/local/sbin/poly \ | ||
&& chmod +x /usr/local/sbin/poly \ | ||
&& /usr/local/sbin/poly version; fi | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="lts/*" | ||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 | ||
|
||
# Clean up package lists | ||
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/clojure | ||
{ | ||
"name": "Clojure (Community)", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
// Update the VARIANT arg to pick a Java version. | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use the -bullseye variants on local arm64/Apple Silicon. | ||
"VARIANT": "17", | ||
// Options | ||
"CLOJURE_VERSION": "1.10.3", | ||
"INSTALL_CLOJURE_CLI": "true", | ||
"INSTALL_BOOT": "true", | ||
"INSTALL_LEININGEN": "true", | ||
"INSTALL_POLYLITH": "true", | ||
"NODE_VERSION": "lts/*" | ||
} | ||
}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"vscjava.vscode-java-pack", | ||
"borkdude.clj-kondo", | ||
"betterthantomorrow.calva" | ||
] | ||
} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "java -version", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters