Giter Club home page Giter Club logo

dcsg's Introduction

dcsg: A systemd service generator for docker-compose

dcsg is a command-line utility for Linux that generates systemd services for Docker Compose projects.

If you have one or more docker compose projects running on your server you might want create a systemd service for each of them.

And dcsg is here to help you with just that. Quickly create systemd services from docker-compose files.

Animation: Using dcsg on a docker-compose project

Usage

dcsg <action> [<path-to-a-docker-compose-file>] [<docker-compose-project-name]>

Install

Register a Docker Compose project as a systemd service:

dcsg install docker-compose.yml

Uninstall

Uninstall the systemd service for the given Docker Compose project:

dcsg uninstall docker-compose.yml

Help

Show the available actions and arguments:

dcsg help

The help for a specific action:

dcsg install --help

What does dcsg do?

dcsg doesn't do much.

For the install action dcsg creates a systemd service (see: installer.go):

  1. Create a systemd service definition in /etc/systemd/system/<project-name>.service
  2. Execute systemctl daemon-reload, enable and start

The name of the service created will be the project name of your docker-compose project.

For the uninstall action dcsg remove the systemd service it created earlier (see: uninstaller.go):

  1. Execute a systemctl stop and disable for the docker-compose service
  2. Delete the systemd service definition from /etc/systemd/system/<project-name>.service
  3. Execute sytemctl daemon-reload

Download

You can download pre-built binaries for Linux (64bit, ARM 5, ARM 6 and ARM 7) from github.com » andreaskoch » dcsg » releases:

curl -L https://github.com/andreaskoch/dcsg/releases/download/v0.3.0/dcsg_linux_amd64 > /usr/local/bin/dcsg
chmod +x /usr/local/bin/dcsg

Build

If you have go installed you can use go get to fetch and build dcsg:

go get github.com/andreaskoch/dcsg

To cross-compile dcsg for the different Linux architectures (AMD64, ARM5, ARM6 and ARM7) you can use the crosscompile action of the make script:

go get github.com/andreaskoch/dcsg
cd $GOPATH/github.com/andreaskoch/dcsg
make crosscompile

Licensing

»dcsg« is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

dcsg's People

Contributors

andreaskoch avatar hermsi1337 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.