Code Monkey home page Code Monkey logo

ishmael's Introduction

Ishmael

This is a tool for poking docker in scripts and gaining specific information such as if a container is passing its health checks at present.

Installing and Updating

You must have the Go compiler installed and correctly configured, then you can run:

go get -u github.com/Nekroze/ishmael/...

Usage

All subcommands support the --help and -h switches to get more information about what can be done but here are some examples:

Check if a container is alive:

This command will do a one off check to see if a container with ID f31760063290 is running. Returns a non zero exit code if the container is not currently running.

ishmael alive f31760063290

Wait for a container to be alive:

This command will do one check every second for 10 seconds to see if a container with ID f31760063290 is running. Returns a non zero exit code if the container is not up and running in time.

ishmael alive --wait 10 f31760063290

Should the container be restarting or not running at all then it will stop immediately.

Check if a container is healthy:

This command will do a one off check to see if a container with ID f31760063290 is healthy. Returns a non zero exit code if the container is not currently healthy.

ishmael healthy f31760063290

Wait for a container to be healthy:

This command will do one check every second for 10 seconds to see if a container with ID f31760063290 is running. Returns a non zero exit code if the container is not healthy in time.

ishmael healthy --wait 10 f31760063290

Should the container be running but not have any health status or not even be running at all then it will stop immediately.

Find the id for a docker compose project's service

Say we have a docker compose project called foo with a service called bar. If we wanted to get the ID of a running instance of the service, the find subcommand is your friend.

ishmael find foo bar

This will return 0 and print out the ID of the first running instance of the service it can find.

Get the addresses a container exposes

If we had a running container called my_nginx_1 and it had declared port 8080 as exposed, we could get the address to this container port using the address subcommand.

ishmael address my_nginx_1

Then we might get 172.16.0.2:8080 depending on the IP address docker assigns it. For containers that use host networking 127.0.0.1 will be given instead in an attempt to access the port on the loopback interface.

ishmael's People

Contributors

nekroze avatar

Watchers

James Cloos avatar  avatar  avatar

ishmael's Issues

Spinner when needed

only display spinner if the first run fails and the command must retry because wait was defined

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.