This repository provides tools and instructions for creating and running custom images for the Try Valkey project. The emulator operates on a 32-bit Alpine Linux base, ensuring a lightweight and efficient environment. The images include the Valkey server and CLI, prepared for booting with all necessary configurations. This project is based on the v86 project. Users seeking additional customization options or expanded emulator support should refer to the v86 repository. This repository contains tools and scripts for building and customizing Valkey images.
- src: Contains files required to build a filesystem that includes Valkey, fully configured and ready to run.
- utils: Provides debugging tools and utilities to modify the image, save states, and make additional customizations.
- example: A working example demonstrating how to use the saved states.
- Prebuilt filesystems and state binaries are hosted on a CDN. The relevant URLs are listed in versions.json.
You can either build the filesystem from scratch (MODE="local"
) or use a prebuilt one (MODE="remote"
).
If a filesystem for your desired version already exists in versions.json, run:
MODE=remote VALKEY_VERSION=<version-tag> ./src/build.sh
A directory named <version-tag>/
will be created.
image_creator.html
will be generated and automatically configured to use remote CDN URLs from versions.json.
Ensure Docker is Installed Verify that Docker is installed and running by executing:
docker --version
If Docker is not installed, refer to the installation guides for your operating system:
- Docker Desktop installation guide (macOS and Windows)
- Docker Engine installation guide (Linux and other OS)
Run:
MODE=local VALKEY_VERSION=<version-tag> \
VALKEY_DOWNLOAD_URL=<download_url> \
VALKEY_DOWNLOAD_SHA=<download_sha> \
./src/build.sh
- For
VALKEY_VERSION
,VALKEY_DOWNLOAD_URL
andVALKEY_DOWNLOAD_SHA
, refer to the Valkey hashes file.
for example:
MODE=local VALKEY_VERSION=8.1.0 \
VALKEY_DOWNLOAD_URL=https://github.com/valkey-io/valkey/archive/refs/tags/8.1.0.tar.gz \
VALKEY_DOWNLOAD_SHA=559274e81049326251fa5b1e1c64d46d3d4d605a691481e0819133ca1f1db44f \
./src/build.sh
A directory named <version-tag>/
will be created with the generated filesystem and state directories.
image_creator.html
will be generated and preconfigured to use the local paths for the generated filesystem.
-
Run a local server:
cd .. python3 -m http.server 8888
-
In web browser, navigate to http://localhost:8888/utils/image_creator.html. Wait for the boot process to complete. You'll know it's finished when data appears in the server log.
-
(optional) Modify the image as needed (e.g., loading keys, editing state via CLI or VM terminal).
-
Click "Download State" to download a binary file of the current state.
-
Compress the binary state file that was downloaded in the previous step.
gzip <binary_state_file>
This ensures compatibility with the Try-Valkey page.
-
After compressing, move the compressed state file to the
<version-tag>/state
directory.mv <binary_state_file>.gz <version-tag>/state/
Use the examples in /example to verify that your saved state works correctly:
- Update the filesystem and state paths to point to your created versions.
- Launch and confirm expected behavior in the emulator.