-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84dd838
commit 2420564
Showing
6 changed files
with
217 additions
and
8 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
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,31 @@ | ||
# Base debian build (latest). | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian | ||
|
||
# Update packages. | ||
RUN apt-get update | ||
|
||
# Set the default shell to zsh | ||
ENV SHELL=/usr/bin/zsh | ||
|
||
# Running everything under zsh | ||
SHELL ["/usr/bin/zsh", "-c"] | ||
|
||
# Dropping privileges | ||
USER vscode | ||
|
||
# Install rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source $HOME/.cargo/env | ||
|
||
# Install uv and add to PATH | ||
# See https://docs.astral.sh/uv/guides/integration/docker/ | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
ENV PATH="/home/vscode/.local/bin:$PATH" | ||
|
||
# Add uv to shell configuration | ||
RUN echo 'export PATH="/home/vscode/.cargo/bin:$PATH"' >> ~/.zshrc | ||
|
||
# Install tools using uv | ||
RUN uv tool install moccasin | ||
|
||
# Clean up | ||
RUN sudo apt-get autoremove -y && sudo apt-get clean -y |
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,49 @@ | ||
{ | ||
// Inspired by https://blog.theredguild.org/where-do-you-run-your-code/ | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
"name": "Cyfrin's Vyper & Moccasin DevContainer", | ||
// You can use image or directly use a Dockerfile or Docker Compose file. | ||
// More info: https://containers.dev/guide/dockerfile | ||
// https://github.com/devcontainers/images/tree/main/src/base-alpine | ||
// "image": "mcr.microsoft.com/devcontainers/base:debian", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": {}, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
"extensions": [ | ||
"tintinweb.vscode-vyper", | ||
"trailofbits.weaudit", | ||
"ms-python.python" | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "/usr/bin/zsh" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [3000], | ||
// Use 'portsAttributes' to set default properties for specific forwarded ports. | ||
// More info: https://containers.dev/implementors/json_reference/#port-attributes | ||
// "portsAttributes": { | ||
// "3000": { | ||
// "label": "Hello Remote World", | ||
// "onAutoForward": "notify" | ||
// } | ||
// }, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// We're using a gist, but you can also reference the raw install-tool from your repo. | ||
// Unless you mount the scripts folder as | ||
"postCreateCommand": "echo Welcome to Cyfrin's dev-container. If you'd like to build your own, you can check out an article The Red Guild have created for you at their blog under https://blog.theredguild.org/where-do-you-run-your-code;zsh" | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
File renamed without changes.
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,31 @@ | ||
# Base debian build (latest). | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian | ||
|
||
# Update packages. | ||
RUN apt-get update | ||
|
||
# Set the default shell to zsh | ||
ENV SHELL=/usr/bin/zsh | ||
|
||
# Running everything under zsh | ||
SHELL ["/usr/bin/zsh", "-c"] | ||
|
||
# Dropping privileges | ||
USER vscode | ||
|
||
# Install rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && source $HOME/.cargo/env | ||
|
||
# Install uv and add to PATH | ||
# See https://docs.astral.sh/uv/guides/integration/docker/ | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
ENV PATH="/home/vscode/.local/bin:$PATH" | ||
|
||
# Add uv to shell configuration | ||
RUN echo 'export PATH="/home/vscode/.cargo/bin:$PATH"' >> ~/.zshrc | ||
|
||
# Install tools using uv | ||
RUN uv tool install moccasin | ||
|
||
# Clean up | ||
RUN sudo apt-get autoremove -y && sudo apt-get clean -y |
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,51 @@ | ||
{ | ||
// Inspired by https://blog.theredguild.org/where-do-you-run-your-code/ | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
"name": "Cyfrin's Vyper & Moccasin DevContainer", | ||
// You can use image or directly use a Dockerfile or Docker Compose file. | ||
// More info: https://containers.dev/guide/dockerfile | ||
// https://github.com/devcontainers/images/tree/main/src/base-alpine | ||
// "image": "mcr.microsoft.com/devcontainers/base:debian", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"workspaceMount": "type=tmpfs,target=/workspace", | ||
"workspaceFolder": "/workspace", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": {}, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
"extensions": [ | ||
"tintinweb.vscode-vyper", | ||
"trailofbits.weaudit", | ||
"ms-python.python" | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "/usr/bin/zsh" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [3000], | ||
// Use 'portsAttributes' to set default properties for specific forwarded ports. | ||
// More info: https://containers.dev/implementors/json_reference/#port-attributes | ||
// "portsAttributes": { | ||
// "3000": { | ||
// "label": "Hello Remote World", | ||
// "onAutoForward": "notify" | ||
// } | ||
// }, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// We're using a gist, but you can also reference the raw install-tool from your repo. | ||
// Unless you mount the scripts folder as | ||
"postCreateCommand": "echo Welcome to Cyfrin's dev-container. If you'd like to build your own, you can check out an article The Red Guild have created for you at their blog under https://blog.theredguild.org/where-do-you-run-your-code;zsh" | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |