diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index d285117975..eac53adbf2 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -4,8 +4,8 @@ on: push: env: - REGISTRY_NODE_IMAGE: openmina/openmina - REGISTRY_FRONTEND_IMAGE: openmina/frontend + REGISTRY_NODE_IMAGE: o1labs/mina-rust + REGISTRY_FRONTEND_IMAGE: o1labs/mina-rust-frontend jobs: build-mina-node-image: @@ -109,3 +109,35 @@ jobs: path: /tmp/digests/* if-no-files-found: error retention-days: 1 + + # Push images to registry + push-images: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') + steps: + - name: Git checkout + uses: actions/checkout@v5 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up environment variables + run: | + if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then + echo "GIT_COMMIT=${GITHUB_SHA:0:8}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "GIT_COMMIT=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + fi + + - name: Build and push mina-rust image + run: | + make docker-build-mina + make docker-push-mina + + - name: Build and push mina-rust-frontend image + run: | + make docker-build-frontend + make docker-push-frontend diff --git a/Makefile b/Makefile index 68c7af515d..8f7ef176ec 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NIGHTLY_RUST_VERSION = "nightly-2025-08-18" # Docker -DOCKER_ORG ?= o1-labs +DOCKER_ORG ?= o1labs # PostgreSQL configuration for archive node OPEN_ARCHIVE_ADDRESS ?= http://localhost:3007 @@ -291,7 +291,7 @@ docker-build-debugger: ## Build debugger Docker image .PHONY: docker-build-frontend docker-build-frontend: ## Build frontend Docker image - docker build -t $(DOCKER_ORG)/mina-rust-frontend:$(GIT_COMMIT) frontend/ + @docker build -t $(DOCKER_ORG)/mina-rust-frontend:$(GIT_COMMIT) frontend/ .PHONY: docker-build-fuzzing docker-build-fuzzing: ## Build fuzzing Docker image @@ -314,7 +314,7 @@ docker-build-light-focal: ## Build light focal Docker image .PHONY: docker-build-mina docker-build-mina: ## Build main Mina Docker image - docker build -t $(DOCKER_ORG)/mina-rust:$(GIT_COMMIT) . + @docker build -t $(DOCKER_ORG)/mina-rust:$(GIT_COMMIT) . .PHONY: docker-build-mina-testing docker-build-mina-testing: ## Build Mina testing Docker image @@ -331,6 +331,16 @@ docker-build-test: ## Build test Docker image docker build -t $(DOCKER_ORG)/mina-rust-test:$(GIT_COMMIT) \ -f node/testing/docker/Dockerfile.test node/testing/docker/ +# Docker push targets + +.PHONY: docker-push-mina +docker-push-mina: ## Push main Mina Docker image to DockerHub + @docker push $(DOCKER_ORG)/mina-rust:$(GIT_COMMIT) + +.PHONY: docker-push-frontend +docker-push-frontend: ## Push frontend Docker image to DockerHub + @docker push $(DOCKER_ORG)/mina-rust-frontend:$(GIT_COMMIT) + # Node running targets .PHONY: run-node run-node: build-release ## Run a basic node (NETWORK=devnet, VERBOSITY=info) diff --git a/docker.md b/docker.md deleted file mode 100644 index 1ad8ab9b65..0000000000 --- a/docker.md +++ /dev/null @@ -1,12 +0,0 @@ -# Openmina Images - -Currently CI builds container images when pushing to the -`feat/standalone_snark_worker` or to a PR targeted to that branch. - -Images are available at the Docker Hub repository `openmina/openmina`. - -For the branch itself, two tags produced, one derived from the commit hash -(first 8 chars), and another one is `latest`. - -For a PR from a branch named `some/branch`, two tags are produced, one is -`some-branch-` and another one is `some-branch-latest`. diff --git a/website/docs/appendix/docker-installation.mdx b/website/docs/appendix/docker-installation.mdx new file mode 100644 index 0000000000..e4e5f457d3 --- /dev/null +++ b/website/docs/appendix/docker-installation.mdx @@ -0,0 +1,64 @@ +--- +title: Docker Installation +description: Docker installation instructions and tested setup scripts +--- + +# Docker Installation Guide + +## Linux (Ubuntu/Debian) + +The following commands are tested on Ubuntu 22.04 and Ubuntu 24.04 in our CI +pipeline: + +import CodeBlock from "@theme/CodeBlock"; +import DockerInstallLinux from "!!raw-loader!../developers/scripts/setup/install-docker.sh"; + + + {DockerInstallLinux} + + +After installation, you'll need to either log out and back in, or use +`newgrp docker` to apply the group membership. + +## macOS + +The following commands are tested on macOS in our CI pipeline: + +import DockerInstallMacOS from "!!raw-loader!../developers/scripts/setup/install-docker-macos.sh"; + + + {DockerInstallMacOS} + + +**Note**: After installation, you need to manually start Docker Desktop from +Applications or Launchpad. + +## Windows + +For Windows, manually download and install +[Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/). + +## Manual Verification + +After installation, verify Docker is working: + +```bash +docker --version +docker run hello-world +``` + +## Alternative Manual Installation + +If you prefer not to use the automated scripts, you can find manual installation +instructions in Docker's official documentation: + +- [Docker on Ubuntu](https://docs.docker.com/engine/install/ubuntu/) +- [Docker Desktop for Mac](https://docs.docker.com/desktop/setup/install/mac-install/) +- [Docker Desktop for Windows](https://docs.docker.com/desktop/setup/install/windows-install/) + +## Testing + +These installation scripts are tested nightly and on-demand in our CI pipeline +to ensure they remain functional across different environments. You can see the +test results in the +[Documentation Scripts workflow](https://github.com/o1-labs/mina-rust/actions/workflows/test-docs-scripts.yaml). diff --git a/website/docs/developers/docker-images.md b/website/docs/developers/docker-images.md new file mode 100644 index 0000000000..3fa6e7dd4a --- /dev/null +++ b/website/docs/developers/docker-images.md @@ -0,0 +1,102 @@ +--- +title: Docker Images +description: + Learn about Mina Rust Docker images, versioning, and how to use them for + development and deployment +--- + +# Mina Rust Docker Images + +The Mina Rust project provides Docker images for easy deployment and testing. + +## Available Images + +Docker images are available at Docker Hub under the `o1labs` organization: + +- **Main Node**: `o1labs/mina-rust` - The core Mina Rust node +- **Frontend**: `o1labs/mina-rust-frontend` - Web dashboard and monitoring + interface + +## Image Tags and Versioning + +### For Production Use + +**Always use version tags for production deployments for stability.** Avoid +using `latest` tags as they may change unexpectedly. + +- **Version tags**: `o1labs/mina-rust:v1.4.2` (recommended for stability) +- **Commit-based tags**: `o1labs/mina-rust:2b9e87b2` (available for accessing + specific features during development, not recommended for general use) + +Example: + +```bash +# Use a version tag (recommended for stability) +docker pull o1labs/mina-rust:v1.4.2 +docker pull o1labs/mina-rust-frontend:v1.4.2 + +# Commit hashes available for development/testing specific features +docker pull o1labs/mina-rust:2b9e87b2 +docker pull o1labs/mina-rust-frontend:2b9e87b2 +``` + +### Automatic Publishing + +Images are automatically built and pushed to Docker Hub: + +- **On develop branch**: When commits are pushed to `develop`, images are tagged + with the commit hash (8 characters) +- **On tags**: When version tags are created, images are tagged with the tag + name + +### Finding Available Tags + +You can find available tags at: + +- [o1labs/mina-rust on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust/tags) +- [o1labs/mina-rust-frontend on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust-frontend/tags) + +## Local Development + +For local development and testing, you can build images using the Makefile: + +```bash +# Build images locally +make docker-build-mina +make docker-build-frontend + +# Push to registry (requires Docker Hub login) +make docker-push-mina +make docker-push-frontend +``` + +## Architecture Support + +Images are built for multiple architectures: + +- `linux/amd64` (x86_64) +- `linux/arm64` (ARM64) + +## Using Docker Images + +### Running a Basic Node + +```bash +# Pull and run the main node +docker pull o1labs/mina-rust:v1.4.2 +docker run -p 8302:8302 o1labs/mina-rust:v1.4.2 +``` + +### Running with Frontend Dashboard + +```bash +# Using Docker Compose (recommended) +# Download the latest release and use the provided docker-compose files + +# Or run containers separately +docker run -d --name mina-node -p 8302:8302 o1labs/mina-rust:v1.4.2 +docker run -d --name mina-frontend -p 8070:8070 o1labs/mina-rust-frontend:v1.4.2 +``` + +For complete setup guides, see the +[Node Operators](../node-operators/getting-started) section. diff --git a/website/docs/node-operators/alpha-testing.md b/website/docs/node-operators/alpha-testing.md index 1318322db6..080ea85083 100644 --- a/website/docs/node-operators/alpha-testing.md +++ b/website/docs/node-operators/alpha-testing.md @@ -14,7 +14,7 @@ Docker. Follow these steps to set up the node and Ensure you have **Docker** installed: -- [Docker Installation Guide for Linux, macOS, and Windows](./docker-installation.md) +- [Docker Installation Guide for Linux, macOS, and Windows](../appendix/docker-installation) ## 2. Download & Start the Node diff --git a/website/docs/node-operators/archive-node.md b/website/docs/node-operators/archive-node.md index fe9fd5280d..3f20af9858 100644 --- a/website/docs/node-operators/archive-node.md +++ b/website/docs/node-operators/archive-node.md @@ -58,7 +58,7 @@ multiple options running simultaneously. ## Prerequisites Ensure Docker and Docker Compose are installed on your system - -[Docker Installation Guide](./docker-installation.md) +[Docker Installation Guide](../appendix/docker-installation) ## Docker compose setup (with archiver process) diff --git a/website/docs/node-operators/block-producer.md b/website/docs/node-operators/block-producer.md index 3a06844f43..c334d01224 100644 --- a/website/docs/node-operators/block-producer.md +++ b/website/docs/node-operators/block-producer.md @@ -9,7 +9,7 @@ complete. ## Prerequisites Ensure Docker and Docker Compose are installed on your system - -[Docker Installation Guide](./docker-installation.md) +[Docker Installation Guide](../appendix/docker-installation) ## Download & Start the Node diff --git a/website/docs/node-operators/docker-installation.md b/website/docs/node-operators/docker-installation.md deleted file mode 100644 index 5b19ec88a0..0000000000 --- a/website/docs/node-operators/docker-installation.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -sidebar_position: 2 -title: Docker Installation -description: - Install the Mina Rust Node using Docker for easy deployment and management ---- - -# Docker Installation Guide - -## Installation for - -- [Debian-based Linux](#docker-installation-on-debian-based-linux) -- [Windows](#docker-installation-on-windows) -- [macOS](#docker-installation-on-macos) - -## Docker Installation on Debian-based Linux - -1. Set up Docker's apt repository: - - ```bash - # Add Docker's official GPG key: - sudo apt-get update - sudo apt-get install ca-certificates curl - sudo install -m 0755 -d /etc/apt/keyrings - sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - sudo chmod a+r /etc/apt/keyrings/docker.asc - - # Add the repository to Apt sources: - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get update - ``` - -2. Install the Docker packages: - - ```bash - sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - ``` - -3. Add your user to the `docker` group: - - ```bash - sudo usermod -aG docker $USER - newgrp docker - ``` - -4. Verify the installation: - - ```bash - docker run hello-world - ``` - ---- - -## Docker Installation on Windows - -1. Download and Install - [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/). - -2. Ensure Docker Desktop is running (check the system tray icon). - ---- - -### Docker Installation on macOS - -1. Download and Install - [Docker Desktop for Mac](https://www.docker.com/products/docker-desktop/). -2. Verify the installation in Terminal: - - ```bash - docker --version - ``` diff --git a/website/docs/node-operators/getting-started.md b/website/docs/node-operators/getting-started.md index 9f8bcd0743..308f270670 100644 --- a/website/docs/node-operators/getting-started.md +++ b/website/docs/node-operators/getting-started.md @@ -36,7 +36,32 @@ Choose your preferred installation method: Docker provides the easiest way to get started with the Mina Rust Node. -[→ Docker Installation Guide](docker-installation) +[→ Docker Installation Guide](../appendix/docker-installation) + +#### Docker Image Usage + +Pre-built Docker images are available on Docker Hub: + +- **Main Node**: `o1labs/mina-rust` +- **Frontend Dashboard**: `o1labs/mina-rust-frontend` + +**Recommended**: Use version tags for stability: + +```bash +# Use version tags (recommended for stability) +docker pull o1labs/mina-rust:v1.4.2 +``` + +**For Development**: Commit hashes are available for accessing specific features +during development, but are not recommended for general use. + +For detailed Docker usage and versioning information, see +[Docker Images](../developers/docker-images). + +Find available tags at: + +- [o1labs/mina-rust on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust/tags) +- [o1labs/mina-rust-frontend on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust-frontend/tags) ### 2. Build from Source diff --git a/website/docs/node-operators/local-demo.md b/website/docs/node-operators/local-demo.md index a8e14493fc..edc86d6c9e 100644 --- a/website/docs/node-operators/local-demo.md +++ b/website/docs/node-operators/local-demo.md @@ -1,7 +1,7 @@ # Run Block Producers on local network -Once you have completed the [pre-requisites](./docker-installation.md) for your -operating system, follow these steps: +Once you have completed the [pre-requisites](../appendix/docker-installation) +for your operating system, follow these steps: ## Setup Option 1: Download Docker Compose Files from the Release diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 050c929e23..bac43014ed 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -111,6 +111,12 @@ const config: Config = { position: 'left', label: 'Developers', }, + { + type: 'docSidebar', + sidebarId: 'appendixSidebar', + position: 'left', + label: 'Appendix', + }, { href: 'https://o1-labs.github.io/mina-rust/api-docs/', label: 'API Docs', @@ -142,6 +148,10 @@ const config: Config = { label: 'Developers', to: '/docs/developers/architecture', }, + { + label: 'Appendix', + to: '/docs/appendix/docker-installation', + }, { label: 'API Documentation', href: 'https://o1-labs.github.io/mina-rust/api-docs/', diff --git a/website/sidebars.ts b/website/sidebars.ts index b584bd50ba..a7c292c876 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -20,7 +20,6 @@ const sidebars: SidebarsConfig = { label: 'Introduction', items: [ 'node-operators/getting-started', - 'node-operators/docker-installation', 'node-operators/building-from-source', ], }, @@ -75,6 +74,13 @@ const sidebars: SidebarsConfig = { 'developers/architecture', ], }, + { + type: 'category', + label: 'Docker', + items: [ + 'developers/docker-images', + ], + }, { type: 'category', label: 'P2P Networking', @@ -104,6 +110,17 @@ const sidebars: SidebarsConfig = { ], }, ], + + // Appendix sidebar - general reference material + appendixSidebar: [ + { + type: 'category', + label: 'Installation References', + items: [ + 'appendix/docker-installation', + ], + }, + ], }; export default sidebars;