A tool for defining and running multi-container Docker applications

Overview

Ikki

crates.io

Ikki is a tool for defining and running multi-container Docker applications. It is similar to Docker Compose but comes with some differences.

ikki-demo

Goals

  • Possible to make one image build dependent on another
  • Possible to "unmigrate" easily
  • Watch filesystem and rebuild what is necessary

The primary goal of Ikki is to make it possible to specify dependencies between multiple image builds. Consider the following two Dockerfiles:

// Dockerfile.assets
FROM node:latest

WORKDIR /assets
// output assets to current workdir
// Dockerfile.main
FROM node:latest

// Copy assets from previously built image
COPY --from=assets /assets ./assets
// start application

When building Dockerfile.main, Docker (by specification) will try to find image called assets locally. If it does not exist, it will try to pull it from the registry. It will not try to build it first, because there is no way to tell it to do so. A common solution is multi-stage builds but if more than one Dockerfile depends on the same base stage/image then duplication is needed. Docker Compose configuration does not help because it only allows to specify dependencies between running containers and not builds. This means that you have to give up declarative configuration partially to run some image builds in order manually. Ikki aims to preserve Compose-like configuration but also add declarative build dependency configuration in the same file. Ikki uses KDL.

The secondary goal is to help the user avoid "vendor-locking" to Ikki and just migrate back to plain Docker CLI commands. This is done with explain command that just reads the Ikki config and translates the declarative configuration to imperative sequence of Docker commands that can be copy-pasted to any bash script as-is.

Usage

Ikki container orchestrator for Docker

USAGE:
    ikki [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -f, --file <FILE>    Path to Ikki configuration file [default: ikki.kdl]
    -h, --help           Print help information
    -V, --version        Print version information

SUBCOMMANDS:
    build
    explain
    help       Print this message or the help of the given subcommand(s)
    up         Build (or pull) all images and start the services

Configuration

Ikki uses KDL for configuration. By default it looks for configuration in ikki.kdl file. The (unfinished) schema can be found in ikki-config\schema.kdl. Currently the schema is not enforced and knuffel library is used instead.

The images node is basically what you would normally find in a Docker Compose file. Only those images that have a service configuration are run as containers with the up command.

The dependencies node is a DAG that specifies the dependencies. Names should match images names under the images configuration.

Example

images {
    image "protobuf" path="./protobuf" output="./output/protobuf" {
        build-arg "PROTOBUF_VERSION" "1.28.0"
        build-arg "PROTOC_VERSION" "21.4"
    }

    image "redis" pull="redis:latest" {
        service {
            ports "6379:6379"
        }
    }
    
    image "db" pull="postgres:latest" {
        service {
            env "POSTGRES_PASSWORD" "example"
            env "POSTGRES_USER" "test"

            ports "5432:5432"
        }
    }

    image "api" path="./api" {
        service {
            mount type="volume" src="cache" dest="/cache"
            mount type="bind" src="./api/config" dest="/config"

            ports "3000:3000"
        }
    }

    image "cli-rust" path="./cli"
}

dependencies {
    api {
        protobuf
        redis
        db
    }
    cli-rust {
        protobuf
    }
}

Explain

By using the explain command it is possible to turn the above config into a sequence of Docker commands:

❯ ikki explain
docker build --build-arg PROTOBUF_VERSION=1.28.0 --build-arg PROTOC_VERSION=21.4 --tag protobuf ./protobuf
docker pull redis:latest
docker pull postgres:latest
docker build --tag api ./api
docker build --tag cli-rust ./cli
docker run --name redis --publish 6379:6379 redis:latest
docker run --name db --env POSTGRES_PASSWORD=example --env POSTGRES_USER=test --publish 5432:5432 postgres:latest
docker run --name api --publish 3000:3000 api

Status

Experimental

Use at your own risk. The following is the rough TODO list:

  • Reach parity with Docker Compose by recognizing more options and passing them to the Docker daemon
  • Distinguish build and run dependencies

Install

From source

cargo install ikki
You might also like...
A multi-connection TCP reverse proxy server and client.

tprox A multi-connection TCP reverse proxy. The tprox server is able to proxy multiple incoming connections to the tprox client over a single TCP conn

The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL.

Graph Node The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL. Graph Node is an open s

A multi-protocol network relay

A multi-protocol network relay

A set of cryptographic primitives for building a multi-hop Proxy Re-encryption scheme, known as Transform Encryption.

recrypt A pure-Rust library that implements a set of cryptographic primitives for building a multi-hop Proxy Re-encryption scheme, known as Transform

A multi-functional lightweight BitTorrent Tracker

Torrust-Axum Tracker Project Description Torrust-Axum Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent Tracker made using

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstracti

A Prometheus Aggregation Gateway for FAAS applications

Gravel Gateway Gravel Gateway is a Prometheus Push Gateway for FAAS applications. In particular it allows aggregation to be controlled by the incoming

A Prometheus Aggregation Gateway for FAAS applications

Gravel Gateway Gravel Gateway is a Prometheus Push Gateway for FAAS applications. In particular it allows aggregation to be controlled by the incoming

A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption
A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

Owner
Kirill Vasiltsov
Kirill Vasiltsov
Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions.

Synthetic Network Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions. Dependenc

Daily 58 Dec 15, 2022
netavark: A container network stack

netavark: A container network stack Netavark is a rust based network stack for containers. It is being designed to work with Podman but is also applic

Containers 230 Jan 2, 2023
Docker daemon API in Rust

Bollard: an asynchronous rust client library for the docker API Bollard leverages the latest Hyper and Tokio improvements for an asynchronous API cont

Niel Drummond 439 Jan 3, 2023
Implementation of the Docker Registry HTTP API V2 in Rust, that can act as a proxy to other registries

Docker registry server and proxy (I'm bad at creating catchy names, but this one is good enough.) This project aims to implement a Docker Registry HTT

l4p1n (Mathias B.) 2 Dec 30, 2022
Convert your docker-compose into excalidraw

excalidocker-rs Rust-based utility to convert docker-compose.yaml files into excalidraw files. Key features Transform your local docker-compose files

Eugene Tolbakov 26 Jun 15, 2023
It's like "docker stats" but with beautiful, real-time charts into your terminal. 📊

?? ds - Real-time Stats with Terminal Charts Visualize container stats with beautiful, real-time charts directly in your terminal. Why ds? Missing Cha

Rafael R. Camargo 5 Oct 3, 2023
A multi-targets ping tool and library, which supports 10,000 packets/second, accurate latency

mping-rs a multi-targets ping tool, which supports 10,000 packets/second, accurate latency. 一个高频ping工具,支持多个目标。 正常的ping一般用来做探测工具,mping还可以用来做压测工具。 Go版本:

smallnest 25 Oct 29, 2023
A telnet chat server written in Rust, running on Lunatic.

Lunatic.chat A telnet chat server written in Rust, running on Lunatic. If you just would like to try it out, join the hosted version with: # US server

Lunatic 101 Jan 2, 2023
🤖 brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers

brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers (plain text data). That is, although it can be accessed from a browser, brwrs will not correctly interpret the browser's GET request.

daCoUSB 3 Jul 30, 2021
An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

An end-to-end encrypted, anonymous IP-hiding, decentralized, audio/video/file sharing/offline messaging multi-device platform built for both communications and application security and performance.

null 2 Apr 27, 2022