Skip to content

Compilation

gg edited this page Jun 27, 2023 · 2 revisions

Container Compilation

The Mina Developer Container (MDC) is a comprehensive developer environment designed specifically for Mina's ZKApps. It offers all the necessary software and tools required to compile, deploy, and run Mina applications. This document provides an overview on how run the MDC image, with Docker being the main software dependency.

Prerequisites

To run MDC locally, ensure that you have Docker (or Podman) installed on your system. As a refresher, Docker is a containerization platform that allows you to package applications and their dependencies into isolated containers. The Mina Developer Container relies on Docker to provide a consistent and reproducible environment for Mina development. Install Docker by following the instructions for your specific operating system.

Setting Up the MDC

Once you have Docker installed, follow the steps below to set up a local instance of the Mina Developer Container:

  1. Pull the Mina Developer Container Image:

    • Open a terminal or command prompt.
    • Run the following command to pull the Mina Developer Container image from Docker Hub:
    docker pull minadevcont/mina-developer-container
    
  2. Run the Mina Developer Container:

    • After pulling the image, you can start an instance of the Mina Developer Container by running the following command:
    docker run -idt --rm --name mdc -p 20188:20188 -p 30000:3000 mina-developer-container
    
    • Replace mdc with the desired name for your container instance
    • The idt parameters will tell docker to run interactively, detached and with a pseudo-TTY
    • The rm parameter tells docker to automatically remove the container when it exits
    • The p parameters will associate a local machine:container port. With both 20188 and 300000
  3. Accessing the Mina Developer Container:

    • Once the container is running, you will be provided with a shell prompt within the container's isolated environment. You can now interact with the container as if it were a standalone development environment.
    • You can access the container's shell by running the following command:
    docker exec -it mdc /bin/bash
    
    • Alternatively, MDC has a ssh deamon running, which allows you to connect using SSH as follows:
    ssh -v -i .ssh/idkey root@localhost -p 20188
    

    Just update the location of the idkey provided by the MDC repository

  4. Developing with the Mina Developer Container:

    • The Mina Developer Container provides all the necessary software and tools required for Mina ZKApp development. You can use the container's shell to navigate, compile, deploy, and run your Mina applications.
    • To compile and run your Mina ZKApps, follow the specific instructions provided by the Mina documentation or resources for your application.
  5. Stopping and Removing the Mina Developer Container:

    • To stop the running container, you can use the following command:
      docker stop mdc
      
    • If you want to remove the container completely, use the following command:
      docker rm mdc
      
      This will remove the container instance and its associated resources in case you did not use the rm command above

Conclusion

The Mina Developer Container offers a ready-to-go development environment for Mina ZKApp development. By leveraging Docker, it provides an isolated workspace with all the necessary software and tools required to compile, deploy, and run Mina applications. Follow the steps outlined in this documentation to set up the Mina Developer Container and simplify your Mina development workflow.

Clone this wiki locally