Since plutus-starter devcontainer on Dockerhub is outdated, and I couldn't figure out how to get it updated, I've built my own.
I hope this can help people who can't set up a Nix environment for whatever reason to be able to build Plutus dapps easily.
We assume your plutus dapp sits under ~/Code/plutus-dapp
Install extension DevContainers.
Copy directory .devcontainer to your Haskell project's root directory. Change the docker image tag in devcontainer.json as you see fit.
Bring up Command palette, and run Dev Containers: Open Folder in Container.
Now you can build the project in VSCode's terminal using cabal build.
If you're using other editors like VIM/Emacs, best way to go about it is to
Start the container:
docker run -it --name plutus-dev-container -v ~/Code/plutus-dapp:/home/code/app bjing/plutus-dev-container:latest
Get inside the container:
docker exec -it plutus-dev-container bash
Since your project is mounted to /home/code/app, we need to build from there.
Inside the container
cd ~/app
cabal build
For building or testing a project on a build pipeline, it's simpler to just run the build or test command in the container as a one-off:
# Build project
docker run -it -v ~/Code/plutus-dapp:/home/code/app bjing/plutus-dev-container:latest ./build.sh
# Test project
docker run -it -v ~/Code/plutus-dapp:/home/code/app bjing/plutus-dev-container:latest ./test.sh
Content type
Image
Digest
sha256:cbe35dd41…
Size
2 GB
Last updated
almost 3 years ago
docker pull bjing/plutus-dev-container