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:

3 Likes

The Juno Emulator for local development just got a big upskill :rocket::flexed_biceps:

:package: New ARM Docker image - your Mac will thank you

:high_voltage: Swapped the good old replica for PocketIC - faster & smoother UX

:soap: No more docker-compose clutter

The emulator is now configured in a juno.config file aka you can delete your docker-compose.yml file! :partying_face:

import {defineConfig} from '@junobuild/config';

export default defineConfig({
  satellite: {
    id: 'fmkjf-bqaaa-aaaal-acpza-cai',
    source: 'out',
  },
  emulator: {
    runner: {
      type: "docker",
      name: "my-custom-container-name"
    },
    skylab: {
      ports: {
        console: 5888
      }
    }
  }
});

:cherries: Cherry on top?

This lays the foundation for supporting more (or different) runners in the future.

Have fun and let me know if anything acts weird!

1 Like