Code Monkey home page Code Monkey logo

docker-logging-plugin's Introduction

docker-logging-plugin

A logging driver for docker

This is a docker logging plugin in its simplest form. You can compile and build the plugin from source and install it using the following 3 steps.

1. Build the code

Since the Dockerfile uses scratch image, you need to cross compile the code for linux with all the dependencies installed

$ CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o docker-logging-driver .

2. Build an image and extract rootfs

Build an image:

$ docker build -t docker-logging-plugin .

Create a temporary container:

$ docker container create —name tmp docker-logging-plugin

Create a plugin directory to put compiled resources:

$ mkdir -p ./plugin/rootfs

Export rootfs to the plugin directory:

$ docker container export tmp | tar -x -C ./plugin/rootfs

3. Add plugin config

$ cp config.json ./plugin/
$ ls ./plugin
config.json 	rootfs/

4. Create plugin

$ docker plugin create jayantsinha/docker-logging-plugin ./plugin
$docker plugin ls
ID                NAME                                       		DESCRIPTION             ENABLED
1f8cc6367162      jayantsinha/docker-logging-plugin:latest   	  jsonfilelog as plugin   false

docker-logging-plugin's People

Contributors

jayantsinha avatar

Watchers

 avatar

Forkers

jerrywang1974

docker-logging-plugin's Issues

Build failing on mac

When I run a build getting below error in Docker version 18.09.2

Sending build context to Docker daemon 129.5kB
Step 1/3 : FROM scratch
--->
Step 2/3 : ADD docker-logging-driver /
ADD failed: stat /var/lib/docker/tmp/docker-builder366291491/docker-logging-driver: no such file or directory

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.