
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
run-container
Advanced tools
run a docker container in nodejs
runs a container using dockerode, bootstrapping the pull & start processes, whilst also exposing a compact function to simplify docker's and dockerode's otherwise complex APIs
import { run, runSimple } from "run-container";
// runSimple, minimal example
const container = await runSimple({ image: "postgres" }); // => Dockerode.Container instance
await container.remove({ force: true });
// runSimple, rich example
await runSimple({
autoRemove: true,
bindMounts: { "/path/to/host/file.sh": "/path/to/container/file.sh" },
cmd: ["bash", "/path/to/container/file.sh"],
env: { KEY: "VALUE" },
image: "bash",
name: "script-fun",
ports: { "4000": "4000" }, // tcp ports only. otherwise, use `run`
});
await container.wait();
await container.remove();
// run
// exposes Dockerodes.ContainerCreateOptions full API,
// which directly reflects the docker engine API!
// https://docs.docker.com/engine/api/latest/
const container = await run({
Image: "postgres",
ExposedPorts: {
"5432/tcp": {},
},
HostConfig: {
AutoRemove: true,
PortBindings: { "5432/tcp": [{ HostPort: "40000" }] },
},
});
// ... do work
await container.remove({ force: true });
see the exported typescript typings in the docs folder, or check out the tiny source.
FAQs
run a docker container in nodejs, as concisely as possible
The npm package run-container receives a total of 1,147 weekly downloads. As such, run-container popularity was classified as popular.
We found that run-container demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.