Code Monkey home page Code Monkey logo

docker-wait's Introduction

Docker Wait

A node.js binary that blocks until a regex match has been made with output from docker logs.

The intended use is in bash files for server deployment where you want to ensure that a docker container has fully loaded

Must be run as root (in order to read your docker logs)

###Installation

    npm install -g docker-wait

###Usage

    docker-wait [path-to-config-file.json|coffee|js]

###Config File

The binary blocks until the regex match has been with ALL listed containers

    {
      timeout: 30, // number of seconds to wait before exiting with error

      logOutput: true, // send the docker logs output to cli
      containers: {

        'container_name': /match this/g,
        'another_container_name': /Lisening on port \d{4}/
      }
    }

Copyright Campbell Morgan 2014

All Pull Requests welcome

Licence MIT

docker-wait's People

Contributors

campbellwmorgan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

docker-wait's Issues

Doesn't work in Node 8

Looks like deprecated fs API usage.

Step 21/23 : RUN docker-wait docker/docker-wait.json
 ---> Running in 46b9d3a4e9f4
/usr/lib/node_modules/docker-wait/lib/main.coffee:56
    contents = fs.readfileSync(configPath);
                  ^

TypeError: fs.readfileSync is not a function
    at Object.<anonymous> (/usr/lib/node_modules/docker-wait/lib/main.coffee:58:17)
    at Object.<anonymous> (/usr/lib/node_modules/docker-wait/lib/main.coffee:1:1)
    at Module._compile (module.js:573:30)
    at Object.loadFile (/usr/lib/node_modules/docker-wait/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/usr/lib/node_modules/docker-wait/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

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.