-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from OliverKillane/enh/development-docker
Docker Based Development
- Loading branch information
Showing
8 changed files
with
222 additions
and
65 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,50 @@ | ||
FROM debian:bookworm-slim | ||
|
||
|
||
# Install basic packages | ||
RUN apt-get update -q | ||
RUN apt-get install -qy build-essential wget curl sudo openssh-client git | ||
|
||
# LATEX: | ||
# Install full texlive distribution (very large) | ||
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 - && \ | ||
cd install-tl-* && \ | ||
perl ./install-tl --no-interaction --no-doc-install --no-src-install | ||
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 | ||
RUN tlmgr install latexindent chktex | ||
|
||
# install inkscape (for tikz) and minted (for code highlighting) | ||
RUN apt-get install -qy inkscape python3 python3-pip pipx | ||
RUN pipx 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 apt-get install -qy libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 | ||
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 |
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,69 @@ | ||
{ | ||
"image": "ghcr.io/oliverkillane/imperial-computing-notes-dev", | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"version": "latest" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"latex-workshop.linting.chktex.enabled": true, | ||
"latex-workshop.latex.tools": [ | ||
{ | ||
"name": "latexmk", | ||
"command": "latexmk", | ||
"args": [ | ||
"-shell-escape", | ||
"-synctex=1", | ||
"-interaction=nonstopmode", | ||
"-file-line-error", | ||
"-pdf", | ||
"-outdir=%OUTDIR%", | ||
"%DOC%" | ||
], | ||
"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": [ | ||
// { | ||
// "source": "${localEnv:HOME}/.ssh", | ||
// "target": "/root/.ssh", | ||
// "type": "bind" | ||
// } | ||
] | ||
} |
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,17 @@ | ||
## Develop | ||
|
||
### From Github Codespaces | ||
Given you have github pro (e.g through the student developer pack) | ||
1. Open the repository in a new codespace | ||
2. Setup git, ssh *...and you're done* | ||
|
||
### From Devcontainer | ||
See the provided [container](../.devcontainer). | ||
1. Install docker desktop | ||
2. Install vscode and the [Dev Container Extension](vscode:extension/ms-vscode-remote.remote-containers) | ||
3. Clone this repository, and open within a devcontainer. | ||
4. Setup git, ssh *...and you're done* | ||
|
||
### Locally | ||
Please use the dockerfile and vscode features from the [container setup](../.devcontainer) as a guide. | ||
- @oliverkillane is using MikTex + vscode + wsl on Windows |
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,4 @@ | ||
## Description | ||
*{A short description of the issue here}* | ||
|
||
*{Include references to incorrect information (to file, line in latex)}* |
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,10 @@ | ||
## Goals | ||
- [ ] Increase the flubbo of the foobar | ||
- [x] Re-jingle the plorb (without wazzo deractance) | ||
- Only semi-jingled, decided against replacement due to additional build complexity | ||
|
||
> :eyes: **Please see zarg formatting** (decreased cadence) | ||
## Chores | ||
- [ ] PDFs regenerated | ||
- [ ] Reformatted |
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,50 @@ | ||
name: Build and Publish Image | ||
run-name: Pushing new Imperial College Notes Devcontainer by @${{ github.actor }} | ||
on: | ||
push: | ||
branches: | ||
- enh/development-docker | ||
paths: | ||
- '.devcontainer/Dockerfile' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: .devcontainer/Dockerfile | ||
sparse-checkout-cone-mode: false | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Enrich 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 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: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.IMPERIAL_NOTES_GHCR_TOKEN }} | ||
- name: Build and Push Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: .devcontainer | ||
push: true | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Oliver Killane | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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