We are absolutely thrilled to announce that we have successfully added a Dev Container for the Internet Computer to both VS Code desktop and Github Codespaces . This addition, which was just approved a few hours ago, will now be globally accessible in every application that supports the dev container specification. Significantly, this marks the first-ever inclusion of a Web3 Dev Container template into such a registry.
List of supporting tools https://containers.dev/supporting
If you have the “Dev Containers” extension, you can start developing on the IC after a few clicks without having to worry about setting your environment. There are a few benefits:
Security - NPM extensions and scripts you run won’t have access to your computer, because they are inside a Docker. It’s pretty insecure to run public projects locally. Deno fixes some of these concerns, but it’s not as popular as Node.
Replicability - Your whole team and the public will be able to run your projects and see the same thing without additional environment setup. Our Dockerfile is based on the one for reproducible builds Internet Computer Loading This means if you get your project running inside a Dev Container, you are one step from creating Dockerfiles that compile your reproducible builds. Think of Docker Containers as reproducible apps. If you are only reproducing the wasm files, that won’t allow others to see how the app works locally without them compromising their security.
If you run this command you will be creating a blank container that’s not mounting any local folder.
You can then start with sns/1_start.blast and get the whole NNS running locally, then launch your local SNS within minutes.
What Dev Containers do?
They are isolated containers you can start and stop whenever you want. Applications inside can’t touch the files outside of containers except for the folders you mounted.
.devcontainer/devcontainer.json - config
.devcontainer/Dockerfile - build instructions
… the rest of the files are examples and will contain example projects to kickstart Motoko, Rust, Azle, Kybra projects.
You can take this folder from the templates and place it in your own projects. You can also do that by clicking this green button and choosing “Add dev configuration files” or typing the command
If you copy the .devcontainer files inside your own project, then all you need to do is hit +
You can also modify the Dockerfile however you want, we are just providing the starting template.
VS Code info about Dev Containers Developing inside a Container using Visual Studio Code Remote Development
Good luck with whatever obstacles there may be ahead and have fun!