Go to the source code of this file.
|
|
#define | STASIS_DOCKER_QUIET 1 << 1 |
| | Flag to squelch output from docker_exec()
|
| |
|
#define | STASIS_DOCKER_QUIET_STDOUT 1 << 2 |
| |
|
#define | STASIS_DOCKER_QUIET_STDERR 1 << 3 |
| |
|
#define | STASIS_DOCKER_BUILD 1 << 1 |
| | Flag for older style docker build.
|
| |
|
#define | STASIS_DOCKER_BUILD_X 1 << 2 |
| | Flag for docker buildx.
|
| |
|
#define | STASIS_DOCKER_IMAGE_COMPRESSION "zstd" |
| | Compress "docker save"ed images with a compression program.
|
| |
|
| int | docker_capable (struct DockerCapabilities *result) |
| |
| int | docker_exec (const char *args, unsigned flags) |
| |
| int | docker_build (const char *dirpath, const char *args, int engine) |
| |
|
int | docker_script (const char *image, char *args, char *data, unsigned flags) |
| |
|
int | docker_save (const char *image, const char *destdir, const char *compression_program) |
| |
|
void | docker_sanitize_tag (char *str) |
| |
|
int | docker_validate_compression_program (char *prog) |
| |
◆ docker_build()
| int docker_build |
( |
const char * | dirpath, |
|
|
const char * | args, |
|
|
int | engine ) |
Build a docker image
if (docker_is.usable) {
printf("Building docker image\n");
fprintf("Docker build failed\n");
exit(1);
}
} else {
fprintf(stderr, "No usable docker installation available\n");
}
int docker_capable(struct DockerCapabilities *result)
Definition docker.c:157
int docker_build(const char *dirpath, const char *args, int engine)
Definition docker.c:67
- Parameters
-
- Returns
◆ docker_capable()
Determine the state of docker on the system
fprintf(stderr, "%s is %savailable, and %susable\n",
docker_is.podman ? "Podman" : "Docker",
docker_is.available ? "" : "not ",
docker_is.usable ? "" : "not ");
exit(1);
}
- Parameters
-
- Returns
- 1 on success, 0 on error
◆ docker_exec()
| int docker_exec |
( |
const char * | args, |
|
|
unsigned | flags ) |
Execute a docker command
Use the STASIS_DOCKER_QUIET flag to suppress all output from stdout and stderr.
if (
docker_exec(
"run --rm -t ubuntu:latest /bin/bash -c 'echo Hello world'", 0)) {
fprintf(stderr, "Docker hello world failed\n");
exit(1);
}
int docker_exec(const char *args, unsigned flags)
Definition docker.c:4
- Parameters
-
| args | arguments to pass to docker |
| flags | |
- Returns
- exit code from "docker"