All Projects → ahmetb → Go Dexec

ahmetb / Go Dexec

Licence: apache-2.0
It's like Go os/exec package but for Docker. What if you could exec programs remotely with the same interface as os/exec?

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Go Dexec

Pythonforwindows
A codebase aimed to make interaction with Windows and native execution easier
Stars: ✭ 370 (-9.09%)
Mutual labels:  rpc
Storyscript
Magical coding language for tomorrow’s developer; the other 1 billion people not in GitHub. 🧙
Stars: ✭ 381 (-6.39%)
Mutual labels:  containers
Bpfd
Framework for running BPF programs with rules on Linux as a daemon. Container aware.
Stars: ✭ 396 (-2.7%)
Mutual labels:  containers
Aws Microservices Deploy Options
This repo contains a simple application that consists of three microservices. Each application is deployed using different Compute options on AWS.
Stars: ✭ 370 (-9.09%)
Mutual labels:  containers
Bastille
Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
Stars: ✭ 377 (-7.37%)
Mutual labels:  containers
Cinf
Command line tool to view namespaces and cgroups, useful for low-level container prodding
Stars: ✭ 389 (-4.42%)
Mutual labels:  containers
Buildkit
concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
Stars: ✭ 4,537 (+1014.74%)
Mutual labels:  containers
Thriftpy2
Pure python approach of Apache Thrift.
Stars: ✭ 402 (-1.23%)
Mutual labels:  rpc
Bitcoin Core
A modern Bitcoin Core REST and RPC client.
Stars: ✭ 379 (-6.88%)
Mutual labels:  rpc
Kube Spawn
A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm & systemd-nspawn. Brought to you by the Kinvolk team.
Stars: ✭ 392 (-3.69%)
Mutual labels:  containers
Go Api Boilerplate
Go Server/API boilerplate using best practices DDD CQRS ES gRPC
Stars: ✭ 373 (-8.35%)
Mutual labels:  rpc
Dogvscat
Sample Docker Swarm cluster stack of tools
Stars: ✭ 377 (-7.37%)
Mutual labels:  containers
Picluster
A Simplified Docker Swarm or Kubernetes Alternative to Container Scheduling and Orchestration
Stars: ✭ 390 (-4.18%)
Mutual labels:  containers
Bk Bcs
蓝鲸智云容器管理平台(BlueKing Container Service)
Stars: ✭ 368 (-9.58%)
Mutual labels:  containers
Nuclio
High-Performance Serverless event and data processing platform
Stars: ✭ 4,213 (+935.14%)
Mutual labels:  containers
Grype
A vulnerability scanner for container images and filesystems
Stars: ✭ 362 (-11.06%)
Mutual labels:  containers
Please Contain Yourself
A Docker tutorial written for people who don't actually know Docker already.
Stars: ✭ 385 (-5.41%)
Mutual labels:  containers
Udash Core
Scala framework for building beautiful and maintainable web applications.
Stars: ✭ 405 (-0.49%)
Mutual labels:  rpc
Vas Quod
🚡 Minimal linux container runtime.
Stars: ✭ 404 (-0.74%)
Mutual labels:  containers
Redeo
High-performance framework for building redis-protocol compatible TCP servers/services
Stars: ✭ 392 (-3.69%)
Mutual labels:  rpc

dexec GoDoc

dexec is a small Go library allowing you to run processes inside Docker containers as if you are running them locally using os/exec package. Read documentation at godoc.org or see examples.

Using dexec, you can do stream processing, off-load computationally expensive parts of your program to a remote fleet of Docker engines. Its interface is strikingly similar to os/exec.

Examples

Check out the following examples:

A Short Example

It takes only a 4-line code change to convert a piece of code using os/exec to use dexec to start running your stuff inside containers.

Here is a minimal Go program that runs echo in a container:

package main

import (
	"log"

	"github.com/ahmetalpbalkan/dexec"
	"github.com/fsouza/go-dockerclient"
)

func main(){
	cl, _ := docker.NewClient("unix:///var/run/docker.sock")
	d := dexec.Docker{cl}

	m, _ := dexec.ByCreatingContainer(docker.CreateContainerOptions{
	Config: &docker.Config{Image: "busybox"}})

	cmd := d.Command(m, "echo", `I am running inside a container!`)
	b, err := cmd.Output()
	if err != nil { log.Fatal(err) }
	log.Printf("%s", b)
}

Output: I am running inside a container!

Use Cases

This library is intended for providing an execution model that looks and feels like os/exec package.

You might want to use this library when:

  • You want to execute a process, but run it in a container with extra security and finer control over resource usage with Docker –and change your code minimally.

  • You want to execute a piece of work on a remote machine (or even better, a pool of machines or a cluster) through Docker. Especially useful to distribute computationally expensive workloads.

For such cases, this library abstracts out the details of executing the process in a container and gives you a cleaner interface you are already familiar with.

Check out more examples →

Read more →

Analytics

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].