Coder Social home page Coder Social logo

oci-register-machine's Introduction

Systemd RegisterMachine

Systemd-machined is a virtual machine and container registration manager. It is a tiny daemon that tracks locally running virtual machines and containers and the processes belonging to them.

This project produces a golang binary that can be used with Docker (with minor code changes). If you clone this branch and build/install register-machine.go, a binary will be placed in /usr/libexec/oci/hooks.d named oci-register-machine. You can change this location by editing HOOKSDIR in the Makefile.

With minor changes to Docker code, this binary will be executed when starting and stopping Docker containers via prestart and poststop hooks. RegisterMachine() and TerminateMachine() are systemd-machined.service methods. These and other methods are described here: systemd-machined freedesktop.org

Running Docker containers with this executable, RegisterMachine() is called just before a container is started and after it is provisioned. All running containers' IDs will be listed when you run the command machinectl or machinectl list. When containers are stopped/exited, TerminateMachine() is called, all container processes are terminated and the container ID is no longer listed in machinectl output.

This doc assumes you are running at least docker version 1.9 with the dockerhooks patch. Also, place this project in your GOPATH.

To build, install, clean-up:

First, clone this branch in your GOPATH, then:

make build

make install

make clean

oci-register-machine's People

Contributors

cgwalters avatar giuseppe avatar lsm5 avatar nalind avatar rhatdan avatar sallyom avatar

Watchers

 avatar  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.