Skip to content

Commit eda3d10

Browse files
authored
Merge pull request #1346 from o1-labs/dw/clean-documentation-docker
Improve documentation for the docker usage
2 parents 4e7adbe + 1e23b5f commit eda3d10

14 files changed

+573
-146
lines changed

.github/actions/push-docker-manifest/action.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ inputs:
1616
dockerhub_token:
1717
description: 'Docker Hub token'
1818
required: true
19+
additional_tags:
20+
description: 'Additional tags to create (comma-separated, optional)'
21+
required: false
1922

2023
runs:
2124
using: 'composite'
@@ -40,6 +43,20 @@ runs:
4043
shell: bash
4144
working-directory: /tmp/digests
4245
run: |
46+
# Build primary tag
47+
TAGS="--tag ${{ inputs.registry_image }}:${{ inputs.git_commit }}"
48+
49+
# Add additional tags if provided
50+
if [[ -n "${{ inputs.additional_tags }}" ]]; then
51+
IFS=',' read -ra ADDITIONAL_TAGS <<< "${{ inputs.additional_tags }}"
52+
for tag in "${ADDITIONAL_TAGS[@]}"; do
53+
tag=$(echo "$tag" | xargs) # trim whitespace
54+
if [[ -n "$tag" ]]; then
55+
TAGS="$TAGS --tag ${{ inputs.registry_image }}:$tag"
56+
fi
57+
done
58+
fi
59+
4360
docker buildx imagetools create \
44-
--tag ${{ inputs.registry_image }}:${{ inputs.git_commit }} \
45-
$(printf '${{ inputs.registry_image }}@sha256:%s ' *)
61+
$TAGS \
62+
$(printf '${{ inputs.registry_image }}@sha256:%s ' *)

.github/workflows/docker.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3434
3535
- name: Login to Docker Hub
36-
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
3736
uses: docker/login-action@v3
3837
with:
3938
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -89,7 +88,6 @@ jobs:
8988
uses: actions/checkout@v5
9089

9190
- name: Login to Docker Hub
92-
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
9391
uses: docker/login-action@v3
9492
with:
9593
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -138,11 +136,14 @@ jobs:
138136
run: |
139137
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
140138
echo "GIT_COMMIT=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
139+
echo "ADDITIONAL_TAGS=develop" >> $GITHUB_ENV
141140
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
142141
echo "GIT_COMMIT=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
142+
echo "ADDITIONAL_TAGS=" >> $GITHUB_ENV
143143
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
144144
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
145145
echo "GIT_COMMIT=${BRANCH_NAME}" >> $GITHUB_ENV
146+
echo "ADDITIONAL_TAGS=" >> $GITHUB_ENV
146147
fi
147148
148149
- name: Push frontend multi-arch manifest
@@ -153,6 +154,7 @@ jobs:
153154
digest_pattern: 'frontend-*-digests-*'
154155
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
155156
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
157+
additional_tags: ${{ env.ADDITIONAL_TAGS }}
156158

157159
# Push node multi-arch manifest (after node build completes)
158160
push-node-image:
@@ -168,11 +170,14 @@ jobs:
168170
run: |
169171
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
170172
echo "GIT_COMMIT=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
173+
echo "ADDITIONAL_TAGS=develop" >> $GITHUB_ENV
171174
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
172175
echo "GIT_COMMIT=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
176+
echo "ADDITIONAL_TAGS=" >> $GITHUB_ENV
173177
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
174178
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
175179
echo "GIT_COMMIT=${BRANCH_NAME}" >> $GITHUB_ENV
180+
echo "ADDITIONAL_TAGS=" >> $GITHUB_ENV
176181
fi
177182
178183
- name: Push node multi-arch manifest
@@ -183,3 +188,4 @@ jobs:
183188
digest_pattern: 'node-digests-*'
184189
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
185190
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
191+
additional_tags: ${{ env.ADDITIONAL_TAGS }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ website/static/api-docs/
1818
ledger/3.0.0devnet
1919
ledger/3.0.0mainnet
2020
ledger/3.0.1devnet
21-
ledger/berkeley_rc1
21+
ledger/berkeley_rc1
22+
mina-workdir

docker-compose.archive.devnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ services:
6161
- "127.0.0.1:3086:3086"
6262

6363
mina-rust-node:
64-
image: openmina/openmina:latest
64+
image: o1labs/mina-rust:${MINA_RUST_TAG:-latest}
6565
container_name: mina-rust-node
6666
environment:
6767
- MINA_ARCHIVE_ADDRESS=http://archive-mina-rust:3086

docker-compose.block-producer.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
services:
22
mina-node:
3-
image: openmina/openmina:${MINA_TAG:-latest}
4-
entrypoint: >
5-
sh -c "mina node --producer-key /root/.mina/producer-key $${COINBASE_RECEIVER:+--coinbase-receiver $$COINBASE_RECEIVER} $${MINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP} $${MINA_LIBP2P_PORT:+--libp2p-port $$MINA_LIBP2P_PORT}"
3+
image: o1labs/mina-rust:${MINA_RUST_TAG:-latest}
4+
entrypoint: ["/bin/sh", "-c"]
5+
command: >
6+
"
7+
ARGS='node --producer-key /root/.mina/producer-key';
8+
if [ -n \"$$COINBASE_RECEIVER\" ]; then ARGS=\"$$ARGS --coinbase-receiver $$COINBASE_RECEIVER\"; fi;
9+
if [ -n \"$$MINA_LIBP2P_EXTERNAL_IP\" ]; then ARGS=\"$$ARGS --libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP\"; fi;
10+
if [ -n \"$$MINA_LIBP2P_PORT\" ]; then ARGS=\"$$ARGS --libp2p-port $$MINA_LIBP2P_PORT\"; fi;
11+
exec mina $$ARGS
12+
"
613
ports:
714
- "3000:3000"
815
- "${MINA_LIBP2P_PORT:-8302}:${MINA_LIBP2P_PORT:-8302}"
@@ -11,12 +18,12 @@ services:
1118
environment:
1219
MINA_PRIVKEY_PASS: "${MINA_PRIVKEY_PASS:-}"
1320
COINBASE_RECEIVER: "${COINBASE_RECEIVER:-}"
14-
MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP}"
15-
MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT}"
21+
MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP:-}"
22+
MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT:-8302}"
1623

1724
frontend:
18-
image: openmina/frontend:${MINA_FRONTEND_TAG:-latest}
25+
image: o1labs/mina-rust-frontend:${MINA_FRONTEND_TAG:-latest}
1926
environment:
2027
MINA_FRONTEND_ENVIRONMENT: compose-producer
2128
ports:
22-
- "8070:80"
29+
- "8070:8070"

docker-compose.local.producers.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
local-producer-cluster:
33
container_name: local-producer-cluster
4-
image: openmina/openmina:0.16.0
4+
image: o1labs/mina-rust:${MINA_RUST_TAG:-latest}
55
environment:
66
- RUST_BACKTRACE=1
77
entrypoint: ["openmina-node-testing", "scenarios-generate", "--name", "simulation-small-forever-real-time"]
@@ -12,8 +12,8 @@ services:
1212

1313
frontend:
1414
container_name: frontend
15-
image: openmina/frontend:0.16.0
15+
image: o1labs/mina-rust-frontend:${MINA_FRONTEND_TAG:-latest}
1616
environment:
1717
MINA_FRONTEND_ENVIRONMENT: block-producers
1818
ports:
19-
- "8070:80"
19+
- "8070:8070"

docker-compose.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
services:
22
mina-node:
3-
image: openmina/openmina:${MINA_TAG:-latest}
4-
entrypoint: >
5-
sh -c "mina node $${MINA_LIBP2P_EXTERNAL_IP:+--libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP} $${MINA_LIBP2P_PORT:+--libp2p-port $$MINA_LIBP2P_PORT}"
3+
image: o1labs/mina-rust:${MINA_RUST_TAG:-latest}
4+
entrypoint: ["/bin/sh", "-c"]
5+
command: >
6+
"
7+
ARGS='node --network devnet';
8+
if [ -n \"$$MINA_LIBP2P_EXTERNAL_IP\" ]; then ARGS=\"$$ARGS --libp2p-external-ip $$MINA_LIBP2P_EXTERNAL_IP\"; fi;
9+
if [ -n \"$$MINA_LIBP2P_PORT\" ]; then ARGS=\"$$ARGS --libp2p-port $$MINA_LIBP2P_PORT\"; fi;
10+
exec mina $$ARGS
11+
"
612
volumes:
713
- ./mina-workdir:/root/.mina:rw
814
ports:
9-
- "3000:3000"
1015
- "${MINA_LIBP2P_PORT:-8302}:${MINA_LIBP2P_PORT:-8302}"
1116
environment:
12-
MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP}"
13-
MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT}"
17+
MINA_LIBP2P_EXTERNAL_IP: "${MINA_LIBP2P_EXTERNAL_IP:-}"
18+
MINA_LIBP2P_PORT: "${MINA_LIBP2P_PORT:-8302}"
1419

1520
frontend:
16-
image: openmina/frontend:${MINA_FRONTEND_TAG:-latest}
21+
image: o1labs/mina-rust-frontend:${MINA_FRONTEND_TAG:-latest}
1722
environment:
1823
MINA_FRONTEND_ENVIRONMENT: compose
1924
ports:
20-
- "8070:80"
25+
- "8070:8070"

website/docs/developers/docker-images.md

Lines changed: 63 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ The Mina Rust project provides Docker images for easy deployment and testing.
1313

1414
Docker images are available at Docker Hub under the `o1labs` organization:
1515

16+
<!-- prettier-ignore-start -->
17+
18+
:::warning Deprecated Repository
19+
20+
Docker images from the
21+
[openmina/openmina](https://hub.docker.com/r/openmina/openmina) repository are
22+
deprecated. Please use the
23+
[o1labs/mina-rust](https://hub.docker.com/r/o1labs/mina-rust) images instead for
24+
the latest updates and support.
25+
26+
:::
27+
28+
<!-- prettier-ignore-stop -->
29+
1630
- **Main Node**: `o1labs/mina-rust` - The core Mina Rust node
1731
- **Frontend**: `o1labs/mina-rust-frontend` - Web dashboard and monitoring
1832
interface
@@ -40,12 +54,40 @@ docker pull o1labs/mina-rust:2b9e87b2
4054
docker pull o1labs/mina-rust-frontend:2b9e87b2
4155
```
4256

57+
### For Development and Testing
58+
59+
For accessing the latest development features, use the `develop` tag:
60+
61+
<!-- prettier-ignore-start -->
62+
63+
:::warning Unstable Development Version
64+
65+
The `develop` tag points to the latest code from the development branch and may
66+
be unstable. Only use this for development, testing, or accessing the newest
67+
features. For production use, always use version tags.
68+
69+
:::
70+
71+
<!-- prettier-ignore-stop -->
72+
73+
```bash
74+
# Latest development version (unstable)
75+
docker pull o1labs/mina-rust:develop
76+
docker pull o1labs/mina-rust-frontend:develop
77+
```
78+
79+
### Latest Tag
80+
81+
The `latest` tag always corresponds to the latest commit on the main branch,
82+
which represents the current stable release state.
83+
4384
### Automatic Publishing
4485

4586
Images are automatically built and pushed to Docker Hub:
4687

4788
- **On develop branch**: When commits are pushed to `develop`, images are tagged
48-
with the commit hash (8 characters)
89+
with the commit hash (8 characters) and also tagged as `develop` for easy
90+
access to the latest development version
4991
- **On release branches**: When commits are pushed to branches starting with
5092
`release/`, images are tagged with the branch name (e.g., `release/v1.5.0`) -
5193
useful for testing release candidates
@@ -59,6 +101,22 @@ You can find available tags at:
59101
- [o1labs/mina-rust on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust/tags)
60102
- [o1labs/mina-rust-frontend on Docker Hub](https://hub.docker.com/r/o1labs/mina-rust-frontend/tags)
61103

104+
## Quick Start with Docker Compose
105+
106+
The easiest way to get started is using the provided docker compose
107+
configuration:
108+
109+
```bash
110+
# Clone the repository
111+
git clone https://github.com/o1-labs/mina-rust.git
112+
cd mina-rust
113+
114+
# Start node and frontend
115+
docker compose up -d
116+
117+
# Access the frontend at http://localhost:8070
118+
```
119+
62120
## Local Development
63121

64122
For local development and testing, you can build images using the Makefile:
@@ -103,36 +161,9 @@ docker pull o1labs/mina-rust:latest
103161
emulation
104162
- **Faster startup**: Native images start faster than emulated ones
105163

106-
### Verifying Architecture
107-
108-
You can verify which architecture you're running:
109-
110-
```bash
111-
docker run --rm o1labs/mina-rust:latest uname -m
112-
# x86_64 on Intel/AMD systems
113-
# aarch64 on ARM systems
114-
```
115-
116-
## Using Docker Images
164+
## For Node Operators
117165

118-
### Running a Basic Node
119-
120-
```bash
121-
# Pull and run the main node
122-
docker pull o1labs/mina-rust:latest
123-
docker run -p 8302:8302 o1labs/mina-rust:latest
124-
```
125-
126-
### Running with Frontend Dashboard
127-
128-
```bash
129-
# Using Docker Compose (recommended)
130-
# Download the latest release and use the provided docker-compose files
131-
132-
# Or run containers separately
133-
docker run -d --name mina-node -p 8302:8302 o1labs/mina-rust:latest
134-
docker run -d --name mina-frontend -p 8070:8070 o1labs/mina-rust-frontend:latest
135-
```
166+
For detailed usage instructions including running block producers, archive
167+
nodes, and configuration examples, see:
136168

137-
For complete setup guides, see the
138-
[Node Operators](../node-operators/getting-started) section.
169+
[→ Node Operators Docker Usage Guide](../node-operators/docker-usage)

0 commit comments

Comments
 (0)