mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-08 05:03:49 -05:00
Compare commits
3 Commits
547d418401
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c745a249f5 | ||
|
|
90af772dd7 | ||
|
|
6ab06db5cb |
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cup"
|
||||
version = "3.4.2"
|
||||
version = "3.4.3"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
"socket": {
|
||||
"type": "string",
|
||||
"description": "The path to the unix socket you would like Cup to use for communication with the Docker daemon. Useful if you're trying to use Cup with Podman.",
|
||||
"description": "The path to the unix socket you would like Cup to use for communication with the Docker daemon. Useful if you're trying to use Cup with Podman. To disable use \"none\" as value.",
|
||||
"minLength": 1
|
||||
},
|
||||
"servers": {
|
||||
|
||||
@@ -23,7 +23,7 @@ For example, if using Podman, you might do
|
||||
$ cup -s /run/user/1000/podman/podman.sock check
|
||||
```
|
||||
|
||||
This option is also available in the configuration file and it's best to put it there.
|
||||
This option is also available in the configuration file and it's best to put it there. If both are defined the CLI `-s` option takes precedence.
|
||||
|
||||
<Cards.Card
|
||||
icon={<IconPlug />}
|
||||
@@ -31,6 +31,8 @@ This option is also available in the configuration file and it's best to put it
|
||||
href="/docs/configuration/socket"
|
||||
/>
|
||||
|
||||
To disable Docker/Podman socket use "none" as value.
|
||||
|
||||
## Configuration file
|
||||
|
||||
Cup has an option to be configured from a configuration file named `cup.json`.
|
||||
|
||||
@@ -17,3 +17,12 @@ You can also specify a TCP socket if you're using a remote Docker host or a [pro
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
Or use the "none" value to disable any Docker/Podman query:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"socket": "none"
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
|
||||
@@ -41,6 +41,9 @@ pub async fn get_images_from_docker_daemon(
|
||||
ctx: &Context,
|
||||
references: &Option<Vec<String>>,
|
||||
) -> Vec<Image> {
|
||||
if ctx.config.socket.as_deref() == Some("none") {
|
||||
return vec![];
|
||||
}
|
||||
let client: Docker = create_docker_client(ctx.config.socket.as_deref());
|
||||
let mut swarm_images = match client.list_services::<String>(None).await {
|
||||
Ok(services) => services
|
||||
@@ -96,6 +99,10 @@ pub async fn get_images_from_docker_daemon(
|
||||
}
|
||||
|
||||
pub async fn get_in_use_images(ctx: &Context) -> Vec<String> {
|
||||
if ctx.config.socket.as_deref() == Some("none") {
|
||||
return vec![];
|
||||
}
|
||||
|
||||
let client: Docker = create_docker_client(ctx.config.socket.as_deref());
|
||||
|
||||
let containers = match client
|
||||
|
||||
@@ -4,7 +4,7 @@ import { theme } from "../theme";
|
||||
export default function Badge({ from, to }: { from: string; to: string }) {
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center rounded-full bg-${theme}-50 px-2 py-1 text-xs font-medium text-${theme}-700 ring-1 ring-inset ring-${theme}-700/10 dark:bg-${theme}-400/10 dark:text-${theme}-400 dark:ring-${theme}-400/30 break-keep`}
|
||||
className={`hidden sm:block inline-flex items-center rounded-full bg-${theme}-50 px-2 py-1 text-xs font-medium text-${theme}-700 ring-1 ring-inset ring-${theme}-700/10 dark:bg-${theme}-400/10 dark:text-${theme}-400 dark:ring-${theme}-400/30 break-keep`}
|
||||
>
|
||||
{from}
|
||||
<ArrowRight className="size-3" />
|
||||
|
||||
Reference in New Issue
Block a user