Juno Local Development Using a Docker Container

Hello :wave:

I’m absolutely pumped to announce that Juno developers can now build locally and run E2E tests against a new Docker image.

This container performs the following tasks:

  • It starts a local replica and icx-proxy
  • A custom CLI deploys Internet Identity and Juno’s Satellite
  • It applies a configuration that the dev can define with a config file
  • That’s it! :partying_face:

So basically, you run docker compose up and you are all set!


docker-compose.yml:

services:
  juno-satellite:
    image: junobuild/satellite:latest
    ports:
      - 5987:5987
    volumes:
      - astro_dapp:/juno/.juno
      - ./juno.dev.json:/juno/juno.dev.json

volumes:
  astro_dapp:

A config file to apply settings to the Satellite smart contract:

{
  "satellite": {
    "collections": {
      "db": [
        {
          "collection": "counter",
          "read": "public",
          "write": "public",
          "memory": "stable"
        }
      ]
    }
  }
}

And basically just setting a variable to the unique initialization function:

await initJuno({
  satelliteId: import.meta.env.PUBLIC_SATELLITE_ID,
  container: true,
});

Blog post: https://juno.build/blog/local-development
Documentation: https://juno.build/docs/miscellaneous/local-development
Repo: https://github.com/junobuild/juno-docker

8 Likes

I’m thrilled to double down on Juno’s custom Docker-based solution by announcing that I have extended our DX by creating an image that can be used to develop Juno itself. :fire:

You need Node, Docker, and Rust (only if you plan to enhance the smart contracts).

From there, just clone the repo and install the dependencies:

git clone https://github.com/junobuild/juno
cd juno
npm ci

Then start the emulator aka the Docker container:

npm run emulator

In another terminal, start the frontend:

npm run dev

That’s it! You can start contributing to Juno. :muscle:

Feedback and potential reports of issues are most welcome.

No more dfx needed to develop anything Juno locally, let’s go! :rocket: :wink:

2 Likes