Skip to content

Commit 6862b38

Browse files
Merge pull request #2136 from ArmDeveloperEcosystem/main
production update
2 parents 304edf4 + 19b7b9f commit 6862b38

File tree

9 files changed

+202
-201
lines changed

9 files changed

+202
-201
lines changed

.wordlist.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,4 +4452,6 @@ zenohd
44524452
Kompanio
44534453
Zenoh's
44544454
instrumentable
4455-
subprocesses
4455+
subprocesses
4456+
CPzfYHdpQ
4457+
iso
Lines changed: 48 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,42 @@
11
---
22
title: Container CLI for macOS
3-
4-
draft: true
5-
63
author: Rani Chowdary Mandepudi
7-
84
minutes_to_complete: 10
9-
105
official_docs: https://github.com/apple/container
11-
126
additional_search_terms:
13-
- container
14-
- virtualization
15-
7+
- container
8+
- virtualization
169
layout: installtoolsall
1710
multi_install: false
1811
multitool_install_part: false
1912
test_maintenance: false
2013
weight: 1
2114
---
2215

23-
Container CLI is an open-source command line tool from Apple for building and running Arm Linux containers directly on macOS using lightweight virtual machines, without the need for Docker Desktop or Linux VMs.
16+
Container CLI is an open-source command-line tool from Apple for building and running Arm Linux containers directly on macOS using lightweight virtual machines without Docker Desktop or full Linux VMs.
2417

2518
It supports the full OCI (Open Container Initiative) workflow: building, running, tagging, and pushing container images.
2619

2720
## What should I do before installing the Container CLI?
2821

29-
This article provides a step-by-step guide to install and use the `container` command-line tool for building and running Arm Linux containers natively on macOS systems with Apple silicon.
22+
This guide shows how to install and use the `container` CLI to run Arm Linux containers natively on Apple silicon Macs.
3023

31-
Confirm you are using an Apple silicon Mac by running:
24+
First, confirm you are using an Apple silicon Mac by running:
3225

3326
```bash
3427
uname -m
3528
```
3629

37-
The output on macOS is:
30+
Expected output:
3831

3932
```output
4033
arm64
4134
```
35+
{{% notice Note %}}
36+
Container CLI supports only Apple silicon Macs (M1, M2, M3, and M4).
37+
{{% /notice %}}
4238

43-
Container CLI only works on Macs with Apple silicon, including M1, M2, M3, and M4.
44-
45-
Use the following command to verify macOS version:
39+
Check your macOS version:
4640

4741
```bash
4842
sw_vers -productVersion
@@ -54,37 +48,35 @@ Example output:
5448
15.5
5549
```
5650

57-
Your computer must be running macOS 15.0 or later to use the Container CLI.
51+
You must be running macOS 15.0 or later to use the Container CLI.
5852

5953
## How do I install Container CLI?
6054

61-
To install Container CLI on macOS, follow the steps below:
55+
To install Container CLI:
6256

63-
From the [official GitHub Release page](https://github.com/apple/container/releases), download the latest signed `.pkg` installer.
57+
Go to the [GitHub Releases page](https://github.com/apple/container/releases) and download the latest signed `.pkg` installer.
6458

6559
For example:
6660

6761
```bash
6862
wget https://github.com/apple/container/releases/download/0.2.0/container-0.2.0-installer-signed.pkg
6963
```
7064

71-
Install the downloaded package using:
65+
Install the package:
7266

7367
```bash
7468
sudo installer -pkg container-0.2.0-installer-signed.pkg -target /
7569
```
7670

77-
This installs the Container binary at `/usr/local/bin/container`
71+
This installs the Container binary at `/usr/local/bin/container`.
7872

79-
After installation, start the container system service by running the following command:
73+
Start the container system service:
8074

8175
```bash
8276
container system start
8377
```
8478

85-
{{% notice Note %}}
86-
The system service must be running to use container operations such as build, run, or push. It may also need to be started again after a reboot, depending on system settings.
87-
{{% /notice %}}
79+
You must start the service to use commands like `build`, `run`, or `push`. It may need to be restarted after rebooting.
8880

8981
The background server process is now running.
9082

@@ -97,119 +89,109 @@ container --version
9789
Example output:
9890

9991
```output
100-
container CLI version 0.2.0
92+
container CLI version 0.2.0
10193
```
10294

103-
This confirms that the Container CLI is successfully installed and ready to use.
104-
105-
## How do I build, run, and push a container using the Container CLI?
106-
107-
### Create a Dockerfile
95+
## Build and run a container
10896

109-
You can define a simple image that prints the system architecture.
11097

111-
Use an editor to create a file named `Dockerfile` with the following contents:
98+
In a working directory, create a file named `Dockerfile`:
11299

113-
```bash
100+
```dockerfile
114101
FROM ubuntu:latest
115102
CMD echo -n "Architecture is " && uname -m
116103
```
117104

118-
### Build the container image
105+
This image prints the system architecture when executed.
119106

120-
Build the image from the `Dockerfile`.
107+
### Build the image
121108

122-
This will pull the Ubuntu base image and tag the result as `uname`.
109+
Run the following to build and tag the container image as `uname`:
123110

124111
```bash
125112
container build -t uname .
126113
```
127114

128-
The output will be similar to:
115+
Example output:
129116

130117
```output
131118
Successfully built uname:latest
132119
```
133120

134-
### Run the container
121+
### Run the container
135122

136-
Execute the container to verify it runs successfully and prints the system architecture.
123+
Run the container to verify it prints the system architecture.
137124

138-
```bash
125+
```bash
139126
container run --rm uname
140127
```
141128

142-
The output is:
129+
Expected output:
143130

144131
```output
145132
Architecture is aarch64
146133
```
147134

148-
The `--rm` flag removes the container after it finishes.
135+
The `--rm` flag cleans up the container after it exits.
149136

150-
### Tag and push the image
137+
## Tag and push the image
151138

152139
Once the image is built and tested locally, it can be pushed to a container registry such as Docker Hub. This allows the image to be reused across machines or shared with others.
153140

154-
Use the `tag` command to apply a registry-compatible name to the image:
141+
Tag the image with a registry-compatible name:
155142

156-
```bash
143+
```bash
157144
container images tag uname docker.io/<your-username>/uname:latest
158145
```
159146

160147
Replace `<your-username>` with your Docker Hub username.
161148

162-
Before pushing the image, log in to Docker Hub:
149+
Log in to Docker Hub:
163150

164-
```bash
151+
```bash
165152
container registry login docker.io
166153
```
167154

168155
Enter your Docker Hub username and password.
169156

170-
{{% notice Note %}}
171157
The same command works with other registries such as GitHub Container Registry (ghcr.io) or any OCI-compliant registry. Replace `docker.io` with the appropriate registry hostname.
172-
{{% /notice %}}
173158

174-
Next, upload the tagged image to Docker Hub.
159+
Next, upload the tagged image to Docker Hub:
175160

176-
```bash
161+
```bash
177162
container images push docker.io/<your-username>/uname:latest
178163
```
179164

180-
Once the push completes successfully, the image will be available in the Docker Hub repository. It can be pulled and run on other systems that support the Arm architecture.
181-
182-
## How can I list images and containers?
165+
## List images and containers
183166

184-
You can view locally built or pulled images using:
167+
To view images:
185168

186-
```bash
169+
```bash
187170
container images ls
188171
```
189172

190-
To see running or previously executed containers:
173+
To view running or stopped containers:
191174

192175
```bash
193176
container ls
194177
```
195178

196179
## How do I uninstall the Container CLI?
197180

198-
The Container CLI includes an uninstall script that allows you to remove the tool from your system. You can choose to remove the CLI with or without user data.
181+
The CLI includes an uninstall script. You can choose whether to keep or delete your container data.
199182

200-
Uninstall and keep user data (images, containers):
183+
If you plan to reinstall later and want to keep your local container data. To uninstall and keep user data (images and containers):
201184

202-
```bash
185+
```bash
203186
uninstall-container.sh -k
204187
```
205188

206-
Use this if you plan to reinstall later and want to preserve your local container data.
207-
208-
Uninstall and delete all user data:
189+
Otherwise, to uninstall and delete all user data:
209190

210191
```bash
211192
uninstall-container.sh -d
212193
```
213-
This will permanently remove the CLI and all container images, logs, and metadata.
214194

215-
You can now build and run Arm Linux containers on macOS.
195+
This will remove the CLI and all related images, logs, and metadata.
196+
197+
You’ve now installed Container CLI and built your first Arm Linux container on macOS.

0 commit comments

Comments
 (0)