- A Docker installation. For Windows, the WSL 2 based engine is recommended.
- Patience. Building and fetching all the sources will take on the order of 30 minutes an can vary widely with the quality of your internet connection and the machine you are using.
- Disk space: images built here are around 12 GB.
Building is required only once on your machine and has to be repeated only for the purpose of updating.
docker-compose build --build-arg PLUTUS_GIT_COMMIT=7b5829f2ac57fcfa25a5969ff602b48641b36ac3
The build argument PLUTUS_GIT_COMMIT
refers to, in principle, any commit of Plutus. It is optional and defaults to the latest commit. (But beware of Docker caching!)
See further below for a list of tested commits.
For the Plutus Pioneer Program, you should target a specific commit. Open the cabal.project
file and look for source-repository-package
with location https://github.com/input-output-hk/plutus.git.
The specified tag, e.g., 7b5829f2ac57fcfa25a5969ff602b48641b36ac3
for week06, should be used as PLUTUS_GIT_COMMIT
.
For older releases that were used in the first cohort of the Plutus Pioneer Program, please checkout the branch first-cohort.
After completing the build step, you can start the most recently built version via:
docker-compose up -d
To visit Plutus Playground, navigate to https://localhost:8009/ and accept the security risk. This may take several minutes to start.
You can also use the plutus-core image to build projects from the Plutus Pioneer Program. The first thing you have to do, is to build the image. If you have previously built the docker-compose file, this will be very fast thanks to Docker's caching feature.
cd build
docker build --target plutus-core --build-arg PLUTUS_GIT_COMMIT=7b5829f2ac57fcfa25a5969ff602b48641b36ac3 --tag plutus-core:cohort2-week2 .
Then, you can run the image inside your existing clone of the Plutus Pioneer Program project:
docker run --volume=${PWD}:/plutus-pionieer-program -it plutus-core:cohort2-week2 nix-shell
Of course, you can also omit the --volume
and clone Plutus Pioneer Program inside the container.
If you encounter an error similar to the following, you probably ran into this open issue of cabal.
dieVerbatim: user error (cabal: '/usr/bin/wget' exited with an error:
/usr/bin/wget: unrecognized option: input-file=-
BusyBox v1.33.1 () multi-call binary.
This error is coming from wget
as provided via apk
. An easy workaround is to install another version of wget
by running nix-env --install wget
, which automatically hides apk
's wget.
You will also need to invoke cabal update
before running cabal build
on one of the projects.
The Playground can be stopped via:
docker-compose down
In case you forgot when you last ran docker-compose build
, you can query the current version of Plutus Playground by
docker exec plutus-playground-docker_server_1 git rev-parse HEAD
The container name plutus-playground-docker_server_1 (auto-generated by Docker compose) might require some adjustments.
This is analog to the previously described setup of the Playground except that you have to specify the alternate compose file.
docker-compose -f docker-compose-docs.yml build --build-arg PLUTUS_GIT_COMMIT=<commit>
docker-compose -f docker-compose-docs.yml up -d
- To visit the Cardano documentation, navigate to http://localhost:8002/.
- To visit the Plutus Haddock documentation, navigate to http://localhost:8081/.
- Insufficient disk space with the WSL 2 based Docker engine on Windows
- Move the disk image from its default location
%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx
to another disk as described here. - The entry
memory
in your wsl configuration may also have to be increased because, as it seems, the default is 50% of your primary disk independent on which disk the image resides.
- Move the disk image from its default location
- Slowing down of your whole system due to paging on insufficient physical memory with the WSL 2 based Docker engine on Windows
- It might help to set the entry
processors
in your wsl configuration to a value that is lower than the number of processors you actually have. Fewer processes consume less memory, which might avoid paging and, hence, even improve the performance.
- It might help to set the entry
- Cardano documentation on Plutus Playground
- Plutus Pioneer Program source code
- Plutus Pioneer Program Gitbook
- Alternative Docker setup of the Plutus Playground, which may be faster if you have a fast internet connection but slow local machine.