Skip to content

Node module to retrieve the Docker Host IP from within a Docker container

Notifications You must be signed in to change notification settings

steadyequipment/node-docker-host-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-host-ip

Node module to retrieve the Docker Host IP from within a Docker container

codebeat badge Codacy Badge dependancies Known Vulnerabilities

Usage

The module is a function that expects to be passed a callback as the only parameter. The callback's parameters should be in standard Node format: (error, result)

Example

import dockerHostIp from 'docker-host-ip';

dockerHostIp( (error, result) => {
	
	if (result) {
		
		console.log("Awesome, we're within a Docker container with Host IP:", result);
	} else if (error) {
		
		console.log("Awww, we got an error. We're probably not in a Docker container...to be safe the error is:", error);
	}
});

About

Node module to retrieve the Docker Host IP from within a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published