Skip to content

Commit 0bfa4df

Browse files
authored
Merge pull request #15 from dotmh/feat/add-dotnet
Add .Net Support
2 parents 0be916d + e891df1 commit 0bfa4df

18 files changed

+195
-22
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.0
1+
9.0.0

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,21 @@ For use with developing applications on Kotlin can be built on top of any base
8585
- [Kotlin](https://kotlinlang.org/)
8686
- [KScript](https://github.com/kscripting/kscript)
8787

88+
## DotNet
89+
90+
![.Net](https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge&logo=.net&logoColor=white)
91+
92+
For use when developing applications on the .net framework, can be built on top of any base
93+
94+
### Tools
95+
96+
- [.net](https://dotnet.microsoft.com/en-us/download)
97+
8898
# Devcontainer Templates
8999

90100
- [Base](devcontainers/base/README.md)
91101
- [Cloud](devcontainers/cloud/README.md)
92102
- [Node](devcontainers/node/README.md)
93103
- [Go](devcontainers/go/README.md)
94104
- [Kotlin](devcontainers/kotlin/README.md)
105+
- [C#](devcontainers/c-sharp/README.md)

containers/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ RUN apt -y install --no-install-recommends bat
2626
RUN wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null &&\
2727
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list &&\
2828
sudo apt update && apt install -y just
29+
30+
# Update zshrc automatically
31+
SHELL ["zsh", "-c"]
32+
RUN cat <<EOL >> $HOME/.zshrc
33+
echo "Starting ....."
34+
alias cat="batcat -P"
35+
alias ls="eza"
36+
EOL

containers/Dotnet.Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ARG base=devcontainer
2+
3+
FROM ghcr.io/dotmh/${base}:latest
4+
5+
ARG version=LTS
6+
7+
LABEL org.opencontainers.image.source=https://github.com/dotmh/devcontainer
8+
LABEL org.opencontainers.image.licenses=apache-2.0
9+
10+
RUN wget https://dot.net/v1/dotnet-install.sh -O ./dotnet-install.sh &&\
11+
chmod +x ./dotnet-install.sh &&\
12+
./dotnet-install.sh --channel ${version}
13+
14+
SHELL ["zsh", "-c"]
15+
RUN echo -e "export PATH=\"$HOME/.dotnet:$PATH\"\n" >> $HOME/.zshrc

containers/Rocky.Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,11 @@ RUN dnf -y install bat
3535

3636
# Install Just https://github.com/casey/just
3737
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/bin
38+
39+
# Update zshrc automatically
40+
SHELL ["zsh", "-c"]
41+
RUN cat <<EOL >> $HOME/.zshrc
42+
echo "Starting ....."
43+
alias cat="bat -P"
44+
alias ls="eza"
45+
EOL

devcontainers/base/devcontainer-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "base",
33
"name": "DotMH Base Dev Container",
4-
"version": "8.0.0",
4+
"version": "9.0.0",
55
"publisher": "DotMH <[email protected]>",
66
"description": "The base dev container for interacting with the base container image",
77
"licenseURL": "https://github.com/dotmh/devcontainer/blob/main/LICENSE",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/dotmh/${templateOption:baseContainer}:latest
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "DotMH C#",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"streetsidesoftware.code-spell-checker",
10+
"ms-dotnettools.csdevkit",
11+
"ms-dotnettools.csharp",
12+
"ms-dotnettools.dotnet-maui",
13+
"github.vscode-github-actions",
14+
"github.copilot",
15+
"github.copilot-chat"
16+
]
17+
}
18+
}
19+
}

devcontainers/c-sharp/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# DotMH Dev Container - C#
2+
3+
A Devcontainer for use with C# development, optionally with tools for working with AWS
4+
5+
![Static Badge](https://img.shields.io/badge/Rocky_Linux-10B981?style=for-the-badge&logo=rockylinux&logoColor=%23FFFFFF)
6+
![Static Badge](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=%23FFFFFF)
7+
![.Net](https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge&logo=.net&logoColor=white)
8+
![C#](https://img.shields.io/badge/c%23-%23239120.svg?style=for-the-badge&logo=csharp&logoColor=white)
9+
10+
- [Rocky Linux](https://rockylinux.org/)
11+
- [Ubuntu](https://ubuntu.com/)
12+
13+
## Tools
14+
15+
- [ZSH](https://www.zsh.org/) (Set as default Shell)
16+
- [OhMyZSH](https://ohmyz.sh/)
17+
- [BAT](https://github.com/sharkdp/bat) - A better Cat command
18+
- [EZA](https://github.com/eza-community/eza) - A better ls command
19+
- [Just](https://github.com/casey/just) - An awesome task runner
20+
- [.net](https://dotnet.microsoft.com/en-us/download) - The dotnet CLI Toolchain
21+
22+
### When Using Cloud containers as the base
23+
24+
![AWS](https://img.shields.io/badge/AWS-%23FF9900.svg?style=for-the-badge&logo=amazon-aws&logoColor=white)
25+
![Terraform](https://img.shields.io/badge/terraform-%235835CC.svg?style=for-the-badge&logo=terraform&logoColor=white)
26+
![DigitalOcean](https://img.shields.io/badge/DigitalOcean-%230167ff.svg?style=for-the-badge&logo=digitalOcean&logoColor=white)
27+
28+
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
29+
- [Digital Ocean CLI](https://docs.digitalocean.com/reference/doctl/)
30+
- [Terraform](https://www.terraform.io/)
31+
32+
## Visual Studio Extentions
33+
34+
![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge&logo=visual-studio-code&logoColor=white)
35+
36+
When using this devcontainer under [Visual Studio Code (vscode)](https://code.visualstudio.com/) with the
37+
[Devcontainer Extention](https://containers.dev/supporting#visual-studio-code), vscode will automatically install
38+
the following extentions
39+
40+
- [A Spellchecker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
41+
- [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
42+
- [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
43+
- [.NET MAUI](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-maui)
44+
- [Github Actions](https://marketplace.visualstudio.com/items?itemName=github.vscode-github-actions)
45+
- [Copilot](https://marketplace.visualstudio.com/items?itemName=github.copilot)
46+
- [Copilot Chat](https://marketplace.visualstudio.com/items?itemName=github.copilot-chat)
47+
48+
## Usage
49+
50+
### Requirements
51+
52+
- [Devcontainer CLI](https://containers.dev/supporting#devcontainer-cli)
53+
54+
### Example
55+
56+
```bash
57+
devcontainer templates apply -w . -t ghcr.io/dotmh/devcontainer/csharp -a '{"baseContainer":"devcontainer-dotnet"}`
58+
```
59+
60+
#### Options
61+
62+
- `baseContainer` :
63+
- `devcontainer-dotnet` _DEFAULT_ - the ubuntu base container
64+
- `devcontainer-rocky-dotnet` - the rocky linux base container
65+
- `devcontainer-cloud-dotnet`- the ubuntu base container with cloud tools
66+
- `devcontainer-rocky-cloud-dotnet` - the rocky linux base container with cloud tools
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "csharp",
3+
"name": "DotMH C# Dev Container",
4+
"version": "9.0.0",
5+
"publisher": "DotMH <[email protected]>",
6+
"description": "The Go dev container for developing with C#",
7+
"licenseURL": "https://github.com/dotmh/devcontainer/blob/main/LICENSE",
8+
"documentationURL": "https://github.com/dotmh/devcontainer/blob/main/devcontainers/go/README.md",
9+
"options": {
10+
"baseContainer": {
11+
"type": "string",
12+
"description": "Which base image to use",
13+
"proposals": [
14+
"devcontainer-dotnet",
15+
"devcontainer-cloud-dotnet",
16+
"devcontainer-rocky-dotnet",
17+
"devcontainer-rocky-cloud-dotnet"
18+
],
19+
"default": "devcontainer-dotnet"
20+
}
21+
},
22+
"platforms": ["Any"]
23+
}

0 commit comments

Comments
 (0)