Repository navigation
Container runtimes restructure and add Apple Container page #10657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
| slug: /ci/integrations/apple-container | ||
| --- | ||
|
|
||
| # Apple's Container Project | ||
|
|
||
| Dagger can be used with any OCI-compatible container runtime, including [`container` from Apple](https://github.com/apple/container). | ||
|
|
||
| :::warning | ||
| The support for Apple's `container` is still early and experimental. | ||
| ::: | ||
|
|
||
| ## How it works | ||
|
|
||
| By default, Dagger tries to invoke the `docker` executable at some points during the invocation of `dagger`. Since `container` is partially CLI-compatible with Docker, some functionality works out of the box, and there is a way to get running by combining a symbolic link named `docker` pointing to the `container` executable, together with the approach of [Custom Runner support](https://docs.dagger.io/configuration/custom-runner). | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - `container` installed and API server running on the host system, through `container system start`. | ||
|
|
||
| ## Example | ||
|
|
||
| To use `container` with Dagger: | ||
|
|
||
| - create a symbolic link in a superior `PATH` position as below: | ||
|
|
||
| ```shell | ||
| sudo ln -s $(which container) /usr/local/bin/docker | ||
| ``` | ||
| - start the Dagger Engine using appropriate values for memory and cpus: | ||
| ```shell | ||
| container run --rm -d \ | ||
| --memory 16G \ | ||
| --cpus 4 \ | ||
| --name dagger-engine-custom \ | ||
| registry.dagger.io/engine:v0.18.12 | ||
| ``` | ||
| - set this env var wherever you want to reach your Dagger Engine: | ||
| ```shell | ||
| export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://dagger-engine-custom | ||
| ``` | ||
|
|
||
| :::info | ||
| there is no `container ps`, so use `container ls` | ||
| ::: | ||
|
|
||
| ## Resources | ||
|
|
||
| If you have any questions about additional ways to use `container` with Dagger, join our [Discord](https://discord.gg/dagger-io) and ask your questions in our [#macos channel](https://discord.com/channels/707636530424053791/1155969163282628639). | ||
|
|
||
| ## About `container` | ||
|
|
||
| [`container`](https://github.com/apple/container) is a tool for creating and running Linux containers using lightweight virtual machines on a Mac. It is written in Swift, and optimized for Apple silicon. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| slug: /ci/integrations/container-runtimes | ||
| --- | ||
|
|
||
| import DocCardList from '@theme/DocCardList'; | ||
|
|
||
| # Running Dagger Engine on Popular Container Runtimes | ||
|
|
||
| We ship Dagger Engine as an OCI image to make it easy to run anywhere you can run containers. This section shows you how to run Dagger Engine on popular container runtimes for dev machines and servers. | ||
|
|
||
| <DocCardList className="DocCardList--no-description"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jpadams had an idea - would having a
apple-container://+apple-image://prefix for_EXPERIMENTAL_DAGGER_RUNNER_HOSTbe useful here?If so, happy to get that setup, it should be pretty simple.
Not quite sure on naming, but ideally it would work similarly to
docker-imageanddocker-container.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jedevc I think that would be really helpful to have those as prefixes.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
But as we were discussing just now with @kpenfound and @jasonmccallister, it will likely be important to have a way for users to specify their container runtime (docker, podman, nerdctl + rancher desktop, nerdctl + lima, apple container, etc) so Dagger can manage the engine lifecycle.
For example, we mostly shell out to
docker pstoday to see if an engine is already running and parse out its version, while with Apple'scontainer, even if you've got a symlink ofdocker->containerthen there is CLI-incompatibility:docker ps✅container ps❌container ls✅docker ls❌