Docker config for Macs running Apple Silicon, to support development on Solana
unfortunately the bozos at Microsoft don't want to support ARM64 so you'll have to build the image yourself before you can use it
docker build github.com/raphtlw/solana-docker-mac-m1 -t raphtlw/solana
Note, docker run
creates a new container every time. The following commands show how you can re-use the same container.
If you'd like to use the container only once as a command, see below.
Create a new instance of a container running a test validator in the background
$ docker run --name solana -d raphtlw/solana solana-test-validator
You can start a test validator inside the container
$ docker exec -it raphtlw/solana solana-test-validator
$ docker exec -it raphtlw/solana fish
You can quickly start a new ephemeral container and run a specific solana program inside
$ docker run --rm -it -v $PWD:/tmp raphtlw/solana <command to run>
You can alias it into a command for easier access:
$ alias solana="docker run --rm -it -v $PWD:/tmp raphtlw/solana"
Example running a solana cluster:
$ solana run-cluster