Skip to content

Commit

Permalink
Fixed devcontainer start
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverKillane committed Sep 27, 2023
1 parent 484168b commit 058ca90
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 13 deletions.
38 changes: 31 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 - && \
Expand All @@ -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
142 changes: 140 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/push-dev-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- enh/development-docker
paths:
- '.devcontainer/**'

jobs:
docker:
Expand All @@ -14,16 +16,19 @@ 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
tags: |
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:
Expand All @@ -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

0 comments on commit 058ca90

Please sign in to comment.