Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
docker-mock
Advanced tools
A mock for Docker!
Require it from your node program:
var dockerMock = require('docker-mock');
dockerMock.listen(5354);
You can also use the command line interface, just run docker-mock
after installing the package globally.
See the tests for some sample usage, but you should be able to point your docker client at this mock and test against it.
This does have support for simulating failures during build. This is done (using dockerode
) by doing the following:
// file is a tar containing at minimum a Dockerfile
var file = ...;
docker.buildImage(
file,
{
t: 'doomedImage',
fail: true
},
function (err, res) {
// err will not be null
});
If you want to disable randomly generated events exposed under /events
endpoint please use ENV var: DISABLE_RANDOM_EVENTS=true
.
You can manually emit docker mock events.
var dockerMock = require('docker-mock');
dockerMock.listen(5354);
dockerMock.events.stream.emit('data', JSON.stringify({status: 'die', from: '..', id: '...', time: '...'}));
// or
dockerMock.events.stream.emit('data', dockerMock.events.generateEvent());
This is currently a work in progress, being built up as use cases come to light. If you would like to contribute, please note this repository is using a git-flow pattern, so please submit pull requests against the develop
branch, and they will be merged into the future release branch and master.
Please make sure all unit tests pass and coverage remains high during development (see below for details).
Testing is done locally via npm test
.
Coverage is done in two ways. First is a readable HTML report:
npm run coverage
Second is coverage reported for Travis CI by travis-cov
. This is invoked via:
npm run travis
If you wish to run both to make sure they pass, you can run:
npm run coverage-all
v0.5.5 (2015/01/07 23:21 +00:00)
FAQs
Mock for Docker
The npm package docker-mock receives a total of 17 weekly downloads. As such, docker-mock popularity was classified as not popular.
We found that docker-mock 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.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.