JSPM

mdock-cache

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q30310F
  • License MIT

An in memory mdock cache to handle multi-request docker run commands

Package Exports

  • mdock-cache

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mdock-cache) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mdock-cache

An in-memory cache for mdock that routes requests to /images/create onto the same server as the previous /containers/create request

install

$ npm install mdock-cache

usage

var http = require('http')
var mdock = require("mdock")
var mdockcache = require("mdock-cache")

var dockers = mdock()

// the mdockcache will remember routing decisions for images
dockers.on('route', mdockcache(function(info, next){
    customRoutingLogic(info, next)
}))

dockers.on('map', function(info, next){
    next()
})

dockers.on('start', function(info, next){
    next()
})

dockers.on('list', function(next){
    next(null, serverList)
})

var server = http.createServer(function(req, res){
    dockers.handle(req, res)
})

server.listen(80)

the cache will keep state between subsequent /containers/create and /images/create requests and route them to the correct address

license

MIT