asterinas/tools/docker
Qingsong Chen 490eaf6c81 Restructure the test directory 2025-07-04 18:52:26 +08:00
..
nix Install nix packages in docker image 2025-07-02 15:39:53 +08:00
tdx Use shallow clone for qemu-tdx 2025-06-09 18:50:43 +08:00
Dockerfile Restructure the test directory 2025-07-04 18:52:26 +08:00
README.md Refactor OSDK and Asterinas Docker build systems 2025-05-06 15:59:38 +08:00
run_dev_container.sh Enable tap mode network and vhost 2024-10-26 22:07:38 +08:00

README.md

Asterinas Development Docker Images

Asterinas development Docker images are provided to facilitate developing and testing Asterinas project. These images can be found in the asterinas/asterinas repository on DockerHub.

Building Docker Images

Asterinas development Docker image is based on an OSDK development Docker image. To build an Asterinas development Docker image and test it on your local machine, navigate to the root directory of the Asterinas source code tree and execute the following command:

cd <asterinas dir>
# Build Docker image
docker buildx build \
    -f tools/docker/Dockerfile \
    --build-arg ASTER_RUST_VERSION=$(grep "channel" rust-toolchain.toml | awk -F '"' '{print $2}') \
    --build-arg BASE_VERSION=$(cat DOCKER_IMAGE_VERSION) \
    -t asterinas/asterinas:$(cat DOCKER_IMAGE_VERSION) \
    .

Intel TDX has some special requirements on the development environment such as QEMU. So we offer a TDX-specific version of the Asterinas development Docker image. You need to build the general-purpose Docker image before building the TDX-specific one as the former is used by the latter one as the base image.

cd <asterinas dir>
# Build Intel TDX Docker image
docker buildx build \
    -f tools/docker/tdx/Dockerfile \
    --build-arg ASTER_RUST_VERSION=$(grep "channel" rust-toolchain.toml | awk -F '"' '{print $2}') \
    --build-arg BASE_VERSION=$(cat DOCKER_IMAGE_VERSION) \
    -t asterinas/asterinas:$(cat DOCKER_IMAGE_VERSION)-tdx \
    .

Tagging and Uploading Docker Images

The Docker images are tagged according to the version specified in the DOCKER_IMAGE_VERSION file at the project root. Check out the version bump documentation on how new versions of the Docker images are released.