Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/darwin-containers/homebrew-formula


https://github.com/darwin-containers/homebrew-formula

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

= Darwin _native_ containers
:source-highlighter: rouge

WARNING: This software is _very_ alpha.
Use at your own risk.

== Installation

Prerequisites:

- Catalina or newer
- Disable https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection[System Integrity Protection].
SIP https://github.com/containerd/containerd/discussions/5525#discussioncomment-2685649[doesn't allow] to `chroot`.
- https://brew.sh[Homebrew]

// TODO: Suggest fuse-t as an alternative to macfuse

[source,shell]
----
# Install packages
brew install --cask macfuse
brew install docker docker-buildx darwin-containers/formula/dockerd

# Start services
sudo brew services start containerd
sudo brew services start dockerd
----

Then, add `"cliPluginsExtraDirs"` to `~/.docker/config.json`, so Docker is able to find buildx plugin:
```json
{
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
}
```

== Usage

Authenticate to GitHub Container Registry using https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry[instructions].

[source,shell]
----
echo | docker login ghcr.io -u --password-stdin
----

Then, run your first Darwin container:

.On Apple Silicon
[source,shell]
----
sudo go run cmd/ctr/main.go run --rm -t --runtime "$(pwd)/../rund/bin/containerd-shim-rund-v1" ghcr.io/darwin-containers/darwin-jail/ventura-arm64:latest my_container /bin/sh -c 'echo "Hello from Darwin container ^_^"'
----

.On Intel
[source,shell]
----
sudo go run cmd/ctr/main.go run --rm -t --runtime "$(pwd)/../rund/bin/containerd-shim-rund-v1" ghcr.io/darwin-containers/darwin-jail/ventura-i386:latest my_container /bin/sh -c 'echo "Hello from Darwin container ^_^"'
----

== How does it work?

See https://github.com/darwin-containers/rund#rund[rund] repository for under-the-hood machinery.