Sign inSign up

bjing/plutus-dev-container

By bjing

•Updated almost 3 years ago

Image
0

951

bjing/plutus-dev-container repository overview

⁠Plutus Dev Container Image

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.

⁠Use the Container

We assume your plutus dapp sits under ~/Code/plutus-dapp

⁠Local development
⁠Visual Studio Code

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.

⁠Command line

If you're using other editors like VIM/Emacs, best way to go about it is to

  1. have an editor open to work on the project, and
  2. have a terminal open to work inside the container to build and test.

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 
⁠Directly Build or Test a Plutus dapp

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
⁠Source Repo

https://github.com/bjing/plutus-dev-container⁠

Tag summary

Content type

Image

Digest

sha256:cbe35dd41…

Size

2 GB

Last updated

almost 3 years ago

docker pull bjing/plutus-dev-container