commit c4cdc4d073c419cedeeadf6f8c9babf99143fc04 Author: Spencer Killen Date: Tue Jan 10 19:22:13 2023 -0700 initial commit diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..e2927c9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "CMPUT 325 devcontainer", + "build": { + "context": "..", + "dockerfile": "../Dockerfile" + }, + "extensions": [ + "mattn.Lisp", + "rebornix.prolog", + "abelcour.asp-syntax-highlight" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f93a00b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.pl": "prolog" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..621961b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:jammy +# rlwrap segfaulted on :kinetic, so using jammy instead +LABEL maintainer="sjkillen@ualberta.ca" + +RUN apt-get -qq update && apt-get -qq install sudo gringo clasp time swi-prolog sbcl rlwrap + +ARG USERNAME=user +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Copied from https://code.visualstudio.com/docs/remote/containers-advanced#_adding-a-nonroot-user-to-your-dev-container +# Create the user +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \ + # [Optional] Add sudo support. Omit if you don't need to install software after connecting. + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME + +USER $USERNAME + +RUN echo "alias sbcl='rlwrap sbcl'" >> /home/$USERNAME/.bashrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ae0a4d --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Notes + +- Container will configure vscode's settings to recognize .pl files as Prolog rather than the default Perl. +- Will install extensions for lisp, prolog, and ASP +- Will configure SBCL to use rlwrap so that you have history when using a lisp REPL + +# How to use + +1. You will need to have vscode and Docker installed. +For Ubuntu, docker is installed with `sudo apt install docker.io` +2. Install the vscode extension for docker dev containers as shown in the image below +![Step 1](howtouse_devcontainer/1.png) + +3. Clone this repository (or just download it) and open the folder that contains the .devcontainer folder + +![Step 2](howtouse_devcontainer/2.png) + +4. Your folder structure should look like the following + +![Step 3](howtouse_devcontainer/3.png) + +5. Open the commands pallete (CTRL + SHIFT + P) or (CTRL + P + >) and type "open in container" and select "Dev Containers: Reopen in Container" + +![Step 4](howtouse_devcontainer/4.png) + +6. It may take a bit to download the docker container, go grab a coffee + +7. Confirm that you're running in the container and have the extensions shown in the following image installed + +![Step 5](howtouse_devcontainer/5.png) + diff --git a/howtouse_devcontainer/1.png b/howtouse_devcontainer/1.png new file mode 100644 index 0000000..2d3908f Binary files /dev/null and b/howtouse_devcontainer/1.png differ diff --git a/howtouse_devcontainer/2.png b/howtouse_devcontainer/2.png new file mode 100644 index 0000000..bdd2fa8 Binary files /dev/null and b/howtouse_devcontainer/2.png differ diff --git a/howtouse_devcontainer/3.png b/howtouse_devcontainer/3.png new file mode 100644 index 0000000..5525eda Binary files /dev/null and b/howtouse_devcontainer/3.png differ diff --git a/howtouse_devcontainer/4.png b/howtouse_devcontainer/4.png new file mode 100644 index 0000000..210dfcf Binary files /dev/null and b/howtouse_devcontainer/4.png differ diff --git a/howtouse_devcontainer/5.png b/howtouse_devcontainer/5.png new file mode 100644 index 0000000..f87a5fa Binary files /dev/null and b/howtouse_devcontainer/5.png differ