diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index eeb3d16..f8d3be7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,17 +1,14 @@ FROM ubuntu:latest -ARG TL_VERSION=2023 -ARG TL_MIRROR=https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz # Install basic packages RUN apt-get update -q -RUN apt-get install -qy build-essential wget sudo - -# Clean up to reduce image size -RUN apt-get clean autoclean && apt-get autoremove -y -RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /usr/local/texlive/${TL_VERSION}/*.log +RUN apt-get install -qy build-essential wget curl sudo +# LATEX: # Install basic texlive distribution +ARG TL_VERSION=2023 +ARG TL_MIRROR=https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz RUN cd /tmp && \ wget --directory-prefix /tmp ${TL_MIRROR} && \ zcat < install-tl-unx.tar.gz | tar xf - && \ @@ -22,3 +19,30 @@ ENV PATH="${PATH}:/usr/local/texlive/${TL_VERSION}/bin/x86_64-linux" # Update packages and tlmgr RUN tlmgr init-usertree RUN tlmgr update --self --all + +# install inkscape (for tikz) and minted (for code highlighting) +RUN apt-get install -qy inkscape python3 python3-pip +RUN pip install pygments + +# C++ +# Already installed GCC as part of build-essential +RUN apt-get install -qy clang-format + +# Rust +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -qy + +# Elixir +RUN apt-get install -qy elixir + +# TLA +# Required Java, toolbox used is included in the VSCode extension +RUN apt-get install -qy default-jdk + +# Haskell +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=latest BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_STACK=1 BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh + +# Clean up to reduce image size +RUN apt-get clean autoclean && apt-get autoremove -y +RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /usr/local/texlive/${TL_VERSION}/*.log + +CMD /usr/bin/bash \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 41167aa..dfd2b5c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,8 +1,146 @@ { - "image": "ghcr.io/oliverkillane/imperial-computing-notes-dev:latest", + "image": "ghcr.io/oliverkillane/imperial-computing-notes-dev:enh-development-docker", "customizations": { "vscode": { - "extensions": [] + "settings": { + "latex-workshop.latex.tools": [ + { + "name": "latexmk", + "command": "latexmk", + "args": [ + "-shell-escape", + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-pdf", + "-outdir=%OUTDIR%", + "%DOC%" + ], + "env": {} + }, + { + "name": "lualatexmk", + "command": "latexmk", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-lualatex", + "-outdir=%OUTDIR%", + "%DOC%" + ], + "env": {} + }, + { + "name": "xelatexmk", + "command": "latexmk", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "-xelatex", + "-outdir=%OUTDIR%", + "%DOC%" + ], + "env": {} + }, + { + "name": "latexmk_rconly", + "command": "latexmk", + "args": [ + "%DOC%" + ], + "env": {} + }, + { + "name": "pdflatex", + "command": "pdflatex", + "args": [ + "-synctex=1", + "-interaction=nonstopmode", + "-file-line-error", + "%DOC%" + ], + "env": {} + }, + { + "name": "bibtex", + "command": "bibtex", + "args": [ + "%DOCFILE%" + ], + "env": {} + }, + { + "name": "rnw2tex", + "command": "Rscript", + "args": [ + "-e", + "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')" + ], + "env": {} + }, + { + "name": "jnw2tex", + "command": "julia", + "args": [ + "-e", + "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")" + ], + "env": {} + }, + { + "name": "jnw2texmintex", + "command": "julia", + "args": [ + "-e", + "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")" + ], + "env": {} + }, + { + "name": "tectonic", + "command": "tectonic", + "args": [ + "--synctex", + "--keep-logs", + "%DOC%.tex" + ], + "env": {} + } + ], + "editor.rulers": [ + { + "column": 80, // spacing of 1st column from left + "color": "#ff9900" // orange, Go Vols! + }, + { + "column": 100, // spacing of 1st column from left + "color": "#ff0000" // orange, Go Vols! + } + ] + }, + "extensions": [ + // For latex vscode setup + "James-Yu.latex-workshop", + // Development Ease + "usernamehw.errorlens", + "GitHub.vscode-pull-request-github", + "GitHub.github-vscode-theme", + "GitHub.vscode-github-actions", + // Diagrams done with drawio + "hediet.vscode-drawio", + // Language Support + "llvm-vs-code-extensions.vscode-clangd", + "ms-vscode.cmake-tools", + "JakeBecker.elixir-ls", + "ms-python.python", + "ms-python.black-formatter", + "rust-lang.rust-analyzer", + "serayuzgur.crates", + "haskell.haskell", + "alygin.vscode-tlaplus" + ] } }, "mounts": [ diff --git a/.github/workflows/push-dev-image.yaml b/.github/workflows/push-dev-image.yaml index c485162..2ca2b98 100644 --- a/.github/workflows/push-dev-image.yaml +++ b/.github/workflows/push-dev-image.yaml @@ -4,6 +4,8 @@ on: push: branches: - enh/development-docker + paths: + - '.devcontainer/**' jobs: docker: @@ -14,7 +16,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Enrich Metadata - id: metadata + id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/oliverkillane/imperial-computing-notes-dev @@ -22,8 +24,11 @@ jobs: type=ref,event=branch type=ref,event=pr type=semver,pattern={{version}} + flavor: | + latest=true labels: | - org.opencontainers.image.description=A container for easy setup in developing the Imperial Computing Note project. + org.opencontainers.image.description=A development image for the imperial computing notes + org.opencontainers.image.vendor=Imperial Computing Notes - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -36,7 +41,7 @@ jobs: context: .devcontainer push: true platforms: linux/amd64 - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max \ No newline at end of file