The Red Guild's devcontainer exploration
Requirements
- Visual Studio Code.
- DevContainer extension by MS:
ms-vscode-remote.remote-containers
.
- Must have installed on your local OS:
docker
and docker-buildx
.
Kick-off
- Start the docker service, and make sure your user is in the
docker
group.
Otherwise, log in back again.
- Clone this repo and open the folder with vscode how you like. Running
code .
works well.
- Select "Reopen in Container" and wait. This will build the container volume.
- If this is your first time, you'll be prompted to press enter on a console
log that triggers the terminal.
- If not you can go to the extensions section on your side, click the Remote
Explorer tab and select the active devcontainer.
Usage
If you open the Command Palette (Ctrl+Shift+p or whatever your shortcut is) you
can access several features:
- You can attach VS Code to a running container, where you can open any folder
or Clone a repository.
- You can open new folders or workspaces of your liking inside the current
volume.
- You can even clone a new repository in a new volume based on the same
devcontainer.
What's in it?
- frameworks: foundry, hardhat (manual install)
- utilities: solc-select
- fuzzing: slither, medusa
- others: node, npm, pnpm, yarn, python, go
- terminal: zsh with Oh-My-ZSH
- extensions:
NomicFoundation.hardhat-solidity
,
tintinweb.solidity-visual-auditor
,
trailofbits.weaudit
,
tintinweb.solidity-metrics
Useful resources
Install different node versions with nvm
# Install the latest version
nvm install --lts
# Install version 14
nvm install 14
# Use a specific version
nvm use 12.22.7
# List current installations
nvm ls
Install Hardhat
Hardhat does not come by default, since the official documentation states
that you should install it locally on the working repository with npx
.
If you wish to install hardhat globally, you can run:
pnpm install hardhat
wherever you want.
The other reason it does not come by default, it's because the nvm
installation is not trivial at all, and working with its peculiarities
inside a Dockerfile to install packages is not worth the mess.
Links