Docker ========== .. note:: If you are running on a non-bare metal server, or prefer not to use VMware and VirtualBox platforms, Docker is the recommended option. For optimal performance, KVM support is recommended. Prerequisite Check ----------------- Before installing Docker, check if your machine supports KVM (recommended for better performance): On Linux, run: .. code-block:: bash egrep -c '(vmx|svm)' /proc/cpuinfo If the return value is greater than zero, your processor supports KVM. .. note:: macOS hosts generally do not support KVM. For macOS users, we recommend using VMware instead. Docker Installation ------------------ Choose the appropriate installation method based on your system: 1. **For systems with GUI**: - For Linux: Follow the `Docker Desktop for Linux `_ installation guide - For Windows: Follow the `Docker Desktop for Windows `_ installation guide 2. **For systems without GUI**: Follow the `Docker Engine installation guide `_ Verification ----------- Verify the installation by running: .. code-block:: bash docker --version Usage Example ------------ To use Docker as your provider, initialize the DesktopEnv with the following parameters: .. code-block:: python # Initialize environment with Docker provider env = DesktopEnv( provider_name="docker", os_type="Ubuntu" # or "Windows" if you want to create a Windows VM ) Clean-up Note ------------ .. important:: If experiments are interrupted abnormally, there may be residual docker containers. To clean up, run: .. code-block:: bash docker stop $(docker ps -q) && docker rm $(docker ps -a -q)