
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-container
Advanced tools
Create a docker container from a node app and run it, because we're hipster like that.
I'd love to hear your feedback. There are a lot of details to flesh out yet. Also checkout my wish list below.
npm install node-container
Give it the path of your node app...it'll do the rest (ideally). Note: The docker daemon needs to run somewhere accessible.
You can do npm test to see it in action.
The first time you run it can take a while, since it needs to fetch the base images.
Subsequent runs should be pretty fast.
var containerize = require('node-container')
// pass it the directory of your node app, config is optional
containerize(__dirname + '/testrepo', config, function (err, container) {
if (err) throw err
console.log('DONE')
console.log(container)
})
container is the output of docker inspect [container].
There you'll find the containers id, pid, network settings etc.
All of these are optional, but you probably want to at least set the docker config.
It can also be specified in the environment as
DOCKER_HOST=tcp://localhost:4243
{
// docker config
host: 'http://localhost',
port: 4243,
// socketPath: '',
// prefix for images and containers, eg 'prefix-appname' or 'prefix/imagename'
prefix: 'tests',
// whether to run the container or not
run: true,
// whether to monitor the node process with mon or not
monitor: true
}
npm packs your app, so you get all the npm goodies you expectvisionmedia/mon) to keep your app runningnpm install --production for your appnpm start for your appmonprocess.env.PORTport: 1234 otherwhise it defaults to 3000. If you don't want to expose it to the world you can set port: falsenpm startOptions you can set in your app's package.json
{
"port": false
}
Take a look add the test app.
If you find a bug, have a feature request or any kind of question, please open an issue or submit a pull request. I'm open for discussing any kind of idea for node-container.
FAQs
Puts a node app into a docker container
We found that node-container 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.