Setting up containers quickly using Parallels Desktop involves deploying a lightweight, optimized Linux virtual machine (VM) configured to run Docker engine. For users on Apple Silicon Macs (M1 through M4 series), Parallels provides a dedicated blueprint that leverages Apple’s Rosetta 2 technology to seamlessly run both standard ARM64 and x86-64 containers. 1. The Fastest Method: One-Click Ubuntu Appliance
Parallels Desktop offers a pre-configured “Ubuntu with Rosetta” system that installs Docker and all required command-line dependencies automatically. Launch Control Center: Open Parallels Desktop on your Mac. Create New VM: Click the ”+” icon or select File > New.
Select the Template: Scroll down to the Free Systems catalog and select Download Ubuntu with Rosetta.
Complete Installation: Click Continue. Parallels will download the template and launch a Terminal window.
Run Containers: Docker CLI comes pre-installed. You can test it instantly by running docker run hello-world in the VM terminal. 2. Manual Custom Setups (For Custom Linux Templates)
If you prefer configuring a custom Linux distribution (e.g., Debian or standard Ubuntu ISO) to host your containers, use these exact steps:
Enable Rosetta: Shut down your Linux VM, open its configuration settings, navigate to Hardware > CPU & Memory, and check Use Rosetta to run x86-64 binaries.
Install Docker: Boot up the VM and install Docker Engine natively using the default terminal commands.
Run x86 Architectures: To run cross-platform containers, add the explicit platform flag when executing commands: docker run –platform linux/amd64 -d postgres Use code with caution. 3. Quick Container Connectivity Tips
Once your container environment is running, connecting it with your host Mac or a neighboring Windows VM requires aligning network settings:
Local Machine Access: Verify your Parallels network is set to Shared Network so your Mac can interface with the container ports using the host’s bridge IP.
VS Code Integration: Use the Parallels Desktop Extension for VS Code to directly start, stop, view logs, and shell into your VM’s Docker containers from the host Mac.
Database & Web Services: When spinning up structural backends (e.g., PostgreSQL), use port mapping configurations like -p 5432:5432 to immediately mirror container environments onto your local development stack.
Are you planning to deploy a specific developer stack (like Node.js, Python, or SQL databases) inside these containers, or do you need assistance configuring the network bridge so your Mac’s browser can see the container apps? Pro Developer and runs x86 Docker Containers in Apple M1
Leave a Reply