Overview
This package consists of a couple of utilities to get IP addresses of containers and host from inside a docker container.
Getting Started
Install this package
using yarn:
yarn add docker-ip-get
or using npm:
npm install docker-ip-get
Here is an example usage:
First, import the library
in CommonJS format:
const dockerIpTools = ;
or in ES6 format:
;
Then, use the utilities as follows:
// Get IP address of the docker hostdockerIpTools ; // Get IP address of the docker container this script is running indockerIpTools ; // Get IP address of the docker gatewaydockerIpTools ; // Check if the system is a docker containerdockerIpTools;
Contributing
If you encounter any issues, please feel free to post an issue here.
Any Pull Requests are welcome!!
Acknowledgements
This project was inspired by docker-ip and this stackoverflow post.
License
docker-ip-get
is MIT Licensed.