Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Repository files navigation

docker-modem

Docker's Remote API network layer module.

docker-modem will help you talking with Docker, since it already implements all the network strategies needed to support all Docker's Remote API endpoints.

It is the module powering (network wise) dockerode and other modules.

Usage

Getting started

varModem=require('docker-modem');varmodem1=newModem({socketPath: '/var/run/docker.sock'});varmodem2=newModem();//defaults to above if env variables are not usedvarmodem3=newModem({host: 'http://192.168.1.10',port: 3000});varmodem4=newModem({protocol:'http',host: '127.0.0.1',port: 3000});varmodem5=newModem({host: '127.0.0.1',port: 3000});//defaults to http

SSH

You can connect to the Docker daemon via SSH in two ways:

  • Using the built-in SSH agent.
  • Implement your own custom agent.
//built-in SSH agentvarmodem1=newModem({prococol: 'ssh',host: 'ssh://127.0.0.1',port: 22});//custom agentvarcustomAgent=myOwnSSHAgent({host: 'ssh://127.0.0.1',port: 22});varmodem2=newModem({agent: customAgent,});

Tests

  • Tests are implemented using mocha and chai. Run them with npm test.
  • Check dockerode tests, which is indirectly co-testing docker-modem.

License

Pedro Dias - @pedromdias

Licensed under the Apache license, version 2.0 (the "license"); You may not use this file except in compliance with the license. You may obtain a copy of the license at:

http://www.apache.org/licenses/LICENSE-2.0.html

Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. See the license for the specific language governing permissions and limitations under the license.

About

Docker Remote API network stack driver.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages