Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

docker-solana

A Docker container for the Solana CLI and spl-token — easily manage your Solana coins and tokens without installing anything locally.

Build Status & Stats

Build Status Image Size Docker Pulls GitHub Issues Last Commit Commit Activity


Features

  • Solana CLI (solana) in a container — no local installation needed
  • SPL Token CLI (spl-token) for managing tokens
  • Easy wallet mounting via Docker volumes
  • Weekly automated rebuilds (Debian security patches + dependency updates)
  • Build ARG for pinning a specific Solana version

Note: This image uses the Agave installer — the actively maintained fork of solana-labs/solana, which was archived in January 2025. The CLI tool names (solana, solana-keygen, spl-token) remain unchanged.


Video Tutorial

How to create a token/coin:

Create a Solana Token


Quick Start

Create a new Solana Wallet

docker run -it --rm andreaskasper/solana:cli solana-keygen new

⚠️ Write down your seed phrase and store it safely! Without it, you cannot recover your wallet.

Check your Balance

docker run -it --rm \
  -v ${PWD}/id.json:/root/.config/solana/id.json:ro \
  andreaskasper/solana:cli solana balance

Work with SPL Tokens

# List all token accounts
docker run -it --rm \
  -v ${PWD}/id.json:/root/.config/solana/id.json:ro \
  andreaskasper/solana:cli spl-token accounts

# Create a new token
docker run -it --rm \
  -v ${PWD}/id.json:/root/.config/solana/id.json:ro \
  andreaskasper/solana:cli spl-token create-token

Interactive Shell (debugging / advanced use)

docker run -it --rm \
  -v ${PWD}/id.json:/root/.config/solana/id.json:ro \
  andreaskasper/solana:cli bash

Docker Compose

A convenient way to run repeated commands with a persistent wallet:

version: "3.8"

services:
  solana:
    image: andreaskasper/solana:cli
    # Mount your wallet file (read-only is recommended for safety)
    volumes:
      - ./id.json:/root/.config/solana/id.json:ro
    # Default command — override when running: docker compose run solana balance
    command: ["--help"]

Usage:

# Show help
docker compose run --rm solana --help

# Check balance
docker compose run --rm solana balance

# SPL token accounts
docker compose run --rm solana spl-token accounts

Building with a custom Solana version

The Solana version is controlled via a build argument, making upgrades easy:

# Build with a specific version
docker build --build-arg SOLANA_VERSION=v2.1.21 -t mysolana:cli src/

# Or the latest stable (check https://github.com/anza-xyz/agave/releases)
docker build --build-arg SOLANA_VERSION=v3.1.8 -t mysolana:cli src/

Environment Variables

Variable Description Default
(none yet) Planned for future releases

Important Paths

Path Description
/root/.config/solana/id.json Wallet keypair file
/root/.local/share/solana/install/active_release/bin Solana CLI binaries

Roadmap

  • Basic Solana CLI image
  • SPL Token CLI
  • Automated weekly CI rebuilds
  • Versioned build ARG (SOLANA_VERSION)
  • GitHub Actions layer cache (faster CI builds)
  • QEMU + Buildx setup for future multi-arch support
  • Docker Compose example
  • Environment variable support (e.g. SOLANA_NETWORK, SOLANA_URL)
  • Automatic version bump PRs via Dependabot / Renovate
  • linux/arm64 support (requires Agave arm64 binaries or source build)
  • Build tests (verify solana --version and spl-token --version output)

Links


Support the project 🛠️

donate via Solana donate via Patreon donate via PayPal

About

A docker container for the solana cli

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages