m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-18 18:03:42 -05:00

3 Commits

Author SHA1 Message Date
Sergio
90af772dd7 chore: bump project version 2025-10-14 18:06:50 +03:00
makonde-on-git
6ab06db5cb feat: allow usage without a daemon (#142) 2025-10-14 18:05:11 +03:00
Sergio
547d418401 docs: fix incorrect compose example with environment variables 2025-09-28 21:49:35 +03:00
5 changed files with 26 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cup"
version = "3.4.2"
version = "3.4.3"
edition = "2021"
[dependencies]

View File

@@ -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": {

View File

@@ -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`.
@@ -131,11 +133,11 @@ services:
ports:
- 8000:8000
environment:
- CUP_AGENT: true
- CUP_IGNORE_UPDATE_TYPE: major
- CUP_REFRESH_INTERVAL: "0 */30 * * * *"
- CUP_SOCKET: tcp://localhost:2375
- CUP_THEME: blue
CUP_AGENT: "true"
CUP_IGNORE_UPDATE_TYPE: major
CUP_REFRESH_INTERVAL: "0 */30 * * * *"
CUP_SOCKET: tcp://localhost:2375
CUP_THEME: blue
```
<Callout>

View File

@@ -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
}
```

View File

@@ -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