Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Integrate Docker containers into a serverless platform or a lambda-based flow via IOpipe.
var Dockaless = require("dockaless")
var dals = Dockaless({
protocol: 'https',
host: '127.0.0.1',
port: process.env.DOCKER_PORT || 2375,
ca: fs.readFileSync('ca.pem'),
cert: fs.readFileSync('cert.pem'),
key: fs.readFileSync('key.pem')
})
export.handler = dals.make_lambda("ubuntu", [ "whoami" ])
This may be leveraged with the IOpipe library to chain execution with local functions, remote functions, and APIs.
var iopipe = require("iopipe")()
var Dockaless = require("dockaless")
var dals = Dockaless()
export.handler = iopipe.define(
iopipe.property("url"),
iopipe.fetch,
dals.make_lambda("ffmpeg", [ "-i", "pipe:0", "-vf", "scale=320:240", "pipe:1" ])
)
This example accepts a JSON document containing a "url" key. A video is fetched from this URL and scaled (resized) using ffmpeg. The video is piped back over the network to the caller, but a script could continue by saving this somewhere (such as S3) as in the following example.
This library combined with the IOpipe library can be used to easily build parallelized tasks requiring use of containerized applications.
The following example is similar to the previous, but converts an array of videos, saves them to storage, and returns URLs to the uploaded content.
var AWS = require('aws-sdk');
var iopipe = require("iopipe")()
var Dockaless = require("dockaless")
var crypto = require("crypto")
var dals = Dockaless()
var s3 = new AWS.S3();
function put_bucket(event, context) {
s3.createBucket({Bucket: event.bucket}, function() {
var params = {Bucket: event.bucket, Key: event.key, Body: event.body};
s3.putObject(params, function(err, data) {
if (err)
context.fail(err)
else
context.succeed(event)
});
});
}
export.handler = iopipe.define(
iopipe.property("urls"),
iopipe.map(
iopipe.fetch,
dals.make_lambda("ffmpeg", [ "-i", "pipe:0", "-vf", "scale=320:240", "pipe:1" ]),
(event, context) => {
var video_hash = crypto.createHash('sha256').update(event).digest('hex')
put_bucket({
bucket: "your_bucket",
key: video_hash
}, context)
},
(event, callback) => {
callback(s3.getSignedUrl('getObject', event))
}
)
)
If dockerode options are not provided, local environment variables will be used. Typically, this will attempt to manage a local Docker daemon via its Unix socket.
Current options are:
See dockerode documentation for more details.
Image is the name of a Docker image.
Cmd are the arguments for the image, overriding CMD. Depending on if there is an entrypoint defined, this either passes arguments to the entrypoint, or executes the command inside the container. (This is standard Docker behavior)
Apache 2.0
FAQs
Docker containers as composable functions
The npm package dockaless receives a total of 3 weekly downloads. As such, dockaless popularity was classified as not popular.
We found that dockaless demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.