Using Mamba with Docker

Use Mamba straightaway with Docker

You can use Mamba right away by using Docker. Install Docker first. Then create a project directory.


$ mkdir mamba_project_dir
$ cd mamba_project_dir

Then you can run Mamba cli program right away.


$ docker run --rm --name mamba  --mount type=bind,source="$(pwd)",destination=/code,consistency=cached arjunaskykok/black-mamba init

If you use Windows, you may want to change source="$(pwd)" with source="your directory in Windows". You can check your mamba_project_dir has been initialized.


$ ls
build			decentralized_app	migrations		test
contracts		deployed		settings.py

Create a Vyper file in contracts directory. You need to change the ownership of the created files first.


$ sudo chown -R your_user:your_user *

Then you can compile it with Docker.


$ docker run --rm --name mamba  --mount type=bind,source="$(pwd)",destination=/code,consistency=cached arjunaskykok/black-mamba compile

Then you need to change the ownership of the compiled code.


$ sudo chown -R your_user:your_user build/*

To test, you can use --test flag of Mamba CLI program. Create a simple test file in test directory.


$ docker run --rm --name mamba  --mount type=bind,source="$(pwd)",destination=/code,consistency=cached arjunaskykok/black-mamba test --file test/test_simple.py