


























Follow ZDNET: Add us as a preferred source on Google.
I've used all sorts of container tools over the years: Docker, Docker Desktop, Podman, Portainer… the list goes on. Most of my container work has been handled on various Linux machines, but every once in a while, I want to work with my MacBook. Either way, I've found there are always choices.
My first choice (when using my MacBook) is to SSH into a Linux machine and work from the command line. But what happens when I don't have a network available (or I'm away from my home)?
Well, there's a new version of the command-line tool for MacOS, called Container, that is just as good as the tools I've used on Linux.
Container has been around since 2025 and is a handy piece of software that allows you to create and run Linux containers as lightweight virtual machines on your MacOS Apple silicon-powered machine. The latest release of Container is optimized specifically for Apple Silicon Mac hardware. If you've ever used the Docker command-line tool, you'll feel right at home with Container.
Also: The best Linux distributions for beginners: Expert tested and reviewed
The difference between Container and Docker is that with Container, each container runs in its own lightweight virtual machine and is launched using a Swift-based init system (vminitd). Container is fast and will be familiar to anyone who has previously worked with tools like Docker or Podman.
I'm going to walk you through the installation and usage of Container on a MacBook, but it can be installed on any desktop or laptop running Apple silicon.
Installing Container is simple.
Once the file has downloaded, double-click it to launch the user-friendly installation Wizard. Walk through the simple steps until the installation is complete.
Show more
Installing Container is much easier than you might think.
That's all there is to installing Container.
Now we get to the fun part.
I'm going to demonstrate how to deploy a simple web server that'll serve a Hello page, displaying "Hello, ZDNET!".
The first thing you must do is start the Container system, which is done with the command:
container system start
You should see no errors in the output. To verify the system has started, run the command to list all running containers (of which there are currently none). That command is:
container list --all
The output of the above command will be:
ID IMAGE OS ARCH STATE IP
If you see that, Container is successfully running and ready to go.
If you know anything about containers, you understand that everything starts with an image. If you've never used containers, think of an image as a stripped-down operating system that contains only what you need to run a particular container.
Also: Linux will be unstoppable in 2026 - but one open-source legend may not survive
The first thing you'll want to do is create a directory to house our little project. Do that with the command:
mkdir hello-web
Change into that new directory with the command:
cd hello-web
The next step is to create a Dockerfile that will contain all of the necessary configurations for our Hello web server. Create the file with the command:
nano Dockerfile
In that file, paste the following contents:
FROM docker.io/python:alpine
WORKDIR /content
RUN apk add curl
RUN echo '<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hello, ZDNET!</h1></body></html>' > index.html
CMD ["python3", "-m", "http.server", "80", "--bind", "0.0.0.0"]
Save and close the file with the keyboard shortcut Ctrl+X.
Let's break down the above:
Next, we have to build our new image that will be used to create the web server container. This is done with the command:
container build --tag hello-web --file Dockerfile .
With the image built, we can now deploy the web server with the command:
container run --name hello-web-server --detach hello-web
The above command deploys a container named hello-web-server in the background (by way of the --detach option) using the hello-web image.
To view your newly deployed web page, you first need to locate the IP address it is using. To do that, issue the command:
container ls
You should see something like this in the output:
hello-web-server hello-web:latest linux arm64 running 192.168.64.3/24 4 1024 MB 2026-06-15T13:23:40Z
The IP address for the above hello-web-server container is 192.168.64.3. If you open your browser and point it to that address, you should see Hello, ZDNET! on the page.
Success!
Congratulations, you just deployed your first container using the Apple silicon-optimized container tool.
Also: How to connect to a VirtualBox virtual machine from your LAN
Although this isn't a point-and-click-friendly tool, there are GUIs, such as ContainerKit, that are in heavy development. There are currently no installable releases for ContainerKit, but you can be certain there will be in the near future. As well, there will be other GUI apps that will eventually appear to help make this tool even easier.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。