Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

![](https://img.shields.io/badge/Powered%20By-GNU%20C-00d000?style=flat&labelColor=gray&logo=C)

> [!WARNING]
> Most of the code is generated by human, maybe even neko.
> If you found any issues, rewrite it with Claude.

# WARNING:
```
* Your warranty is void.
Expand Down Expand Up @@ -47,6 +51,7 @@ And, don't forget to `rurima ota` to get the latest build!
# What's new:
- We have a unified `pull` command to get images from dockerhub or LXC mirror now.
- Some other OCI compatible registry like ghcr.io could work with `-f/--fallback` option enabled now.
- We will automatically force enable fallback mode for ghcr.io now.
# Backward compatibility:
We promise that rurima has backward compatibility of documented parts since v0.9.x, all unstable parts will be explicitly marked as WIP or unstable, and ruri has already been backward compatible. Users can always keep `rurima ota` to get the latest build.
For any issue, please notify us, and we will fix it ASAP.
Expand Down
1 change: 1 addition & 0 deletions doc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Subcommands:
search: Search images from DockerHub.
tag: Search tags from DockerHub.
pull: Pull image from DockerHub.
load: Load rootfs from tarball.
config: Get config of image from DockerHub.
arch: Search architecture of image from DockerHub.
help: Show help message.
Expand Down
4 changes: 0 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ int main(int argc, char **argv)
rurima_netns_wrapper(argc - i - 1, &argv[i + 1]);
return 0;
}
if (strcmp(argv[i], "load") == 0) {
rurima_load_rootfs(argc - i - 1, &argv[i + 1]);
return 0;
}
if (strcmp(argv[i], "QwQ") == 0) {
rurima_QwQ();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ruri
Submodule ruri updated from 3746bb to e612c4
11 changes: 11 additions & 0 deletions src/subcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ static void docker_pull_try_mirrors(const char *_Nonnull image, const char *_Non
*/
void rurima_docker(int argc, char **_Nonnull argv)
{
// rurima docker load
if (argc > 0 && (strcmp(argv[0], "load") == 0)) {
rurima_load_rootfs(argc - 1, &argv[1]);
return;
}
if (!rurima_jq_exists()) {
rurima_error("{red}jq is not installed!\n");
}
Expand Down Expand Up @@ -233,6 +238,11 @@ void rurima_docker(int argc, char **_Nonnull argv)
rurima_warning("{yellow}You use it as your own risk.\n")
}
}
// For ghcr.io, we enable fallback mode by default.
if (strncmp(mirror, "ghcr.io", 7) == 0) {
rurima_warning("{yellow}ghcr.io detected, enabling fallback mode by default for compatibility.\n");
fallback = true;
}
if (strcmp(argv[0], "search") == 0) {
if (image == NULL) {
rurima_error("{red}No image specified!\n");
Expand Down Expand Up @@ -327,6 +337,7 @@ void rurima_docker(int argc, char **_Nonnull argv)
cprintf("{base} search: Search images from DockerHub.\n");
cprintf("{base} tag: Search tags from DockerHub.\n");
cprintf("{base} pull: Pull image from DockerHub.\n");
cprintf("{base} load: Load rootfs from tarball.\n");
cprintf("{base} config: Get config of image from DockerHub.\n");
cprintf("{base} arch: Search architecture of image from DockerHub.\n");
cprintf("{base} help: Show help message.\n");
Expand Down
Loading