A Compose Spec implementation that runs on Podman, written in MoonBit
Dependencies
$ podcomp up -d
$ podcomp ps
$ podcomp logs -f web
$ podcomp down# Installer script (Linux x86-64/arm64, macOS arm64)
curl -LsSf https://raw.githubusercontent.com/tomasky/podcomp/main/install.sh | bash
# npm
npm install -g @tomasko/podcomp
# From source
git clone https://github.com/tomasky/podcomp && cd podcomp
moon build --target native --releaseup create and start the stack
down stop and remove the stack
ps list containers
logs show container logs
start start services
stop stop services
restart restart services
kill kill services
rm remove stopped containers
pull pull service images
build build service images
images list service images
exec run a command in a running container
run run a one-off command in a new container
port print the host port for a published port
pause pause services
unpause unpause services
config print the merged compose file
version show the versionservices:
web:
image: docker.io/library/nginx:alpine
ports:
- "8080:80"
volumes:
- ./html:/usr/share/nginx/html:ro
depends_on:
- db
db:
image: docker.io/library/postgres:16
environment:
POSTGRES_PASSWORD: secret
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
retries: 5
volumes:
pgdata: {}$ podcomp --dry-run up
podman pod exists pod_demo
podman pod create --name=pod_demo --infra=false --share=
podman network exists demo_default
podman network create --label io.podman.compose.project=demo ... demo_default
podman create --name=demo_db_1 --pod=pod_demo ... docker.io/library/postgres:16
podman create --name=demo_web_1 --pod=pod_demo --requires=demo_db_1 ... nginx:alpine
podman start -a demo_db_1
podman start -a demo_web_1moon check --target native --deny-warn
moon test --target native
moon build --target native --release
# _build/native/release/build/cmd/main/main.exepub(all) suberror PodCompError {
PodCompError(String)
}pub struct CommandArgs {
services : Array[String]
detach : Bool
no_deps : Bool
no_build : Bool
build : Bool
force_recreate : Bool
no_recreate : Bool
no_start : Bool
volumes : Bool
remove_orphans : Bool
rmi : String?
timeout : Int?
follow : Bool
tail : String?
since : String?
until : String?
timestamps : Bool
names : Bool
no_color : Bool
no_log_prefix : Bool
quiet : Bool
format : String?
short : Bool
signal : String?
all : Bool
index : Int
protocol : String
private_port : Int
no_cache : Bool
pull : String?
build_arg : Array[String]
quiet_pull : Bool
wait : Bool
wait_timeout : Int?
name : String?
entrypoint : String?
env : Array[String]
user : String?
workdir : String?
rm : Bool
publish : Array[String]
service_ports : Bool
volume : Array[String]
no_tty : Bool
privileged : Bool
force_local : Bool
services_flag : Bool
no_normalize : Bool
pull_always : Bool
abort_on_container_exit : Bool
abort_on_container_failure : Bool
exit_code_from : String?
no_attach : Array[String]
scale : String?
renew_anon_volumes : Bool
no_hosts : Bool
cnt_command : Array[String]
}pub struct Compose {
project_name : String
dirname : String
files : Array[String]
environ : Map[String, String]
services : Map[String, Yaml]
deps : Map[String, Array[String]]
container_names_by_service : Map[String, Array[String]]
containers : Array[Yaml]
container_by_name : Map[String, Yaml]
networks : Map[String, Yaml]
vols : Map[String, Yaml]
declared_secrets : Map[String, Yaml]
default_net : String?
pods : Array[String]
merged_yaml : Yaml
x_podman : Map[String, Yaml]
podman_version : String?
pod_args : Array[String]
env_file_cache : Map[String, Map[String, String]]
}pub struct GlobalOptions {
files : Array[String]
project_name : String?
profiles : Array[String]
env_files : Array[String]
podman_path : String
dry_run : Bool
verbose : Bool
no_ansi : Bool
no_cleanup : Bool
in_pod : String?
pod_args : String?
podman_args : Array[String]
podman_cmd_args : Map[String, Array[String]]
}fn abspath(path : String) -> Stringfn ascii_lower(s : String) -> Stringasync fn cmd_pause_unpause(compose : Compose, podman : Podman, args : CommandArgs, action : String) -> Intfn current_dir() -> Stringfn error_text(error : Error) -> Stringfn is_git_url(path : String) -> Boolfn path_abspath(base : String, path : String) -> Stringfn path_expand_home(path : String) -> Stringfn path_join(a : String, b : String) -> Stringfn path_normalize(path : String) -> Stringfn short_mount_target(spec : String) -> String?fn simple_hash(s : String) -> Stringfn str_to_seconds(text : String) -> Int?fn try_int_str(s : String) -> Int?let version : Stringfn version_at_least(have : String, want : String) -> BoolInstall
Download zipA Compose Spec implementation that runs on Podman, written in MoonBit
Dependencies