
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
@mongodb-js/devtools-docker-test-envs
Advanced tools
DevTools Team docker images and environments for testing
DevTools Team docker images and environments for testing.
This README is generated from the README.tmpl.md
and all the README.md
in the subfolders. Call bash generate-readme.sh
to update it.
docker-compose -f docker/<directory>/docker-compose.yaml up
This repository contains a set of Docker images and docker-compose configurations to start various setup of the server for testing.
In order to start the environments you will need:
docker
and docker-compose
/etc/hosts
(required for some of the setups)docker
and docker-compose
are both installed as part of Docker for Desktop: https://www.docker.com/products/docker-desktop.
Each setup has its own folder and docker-compose.yaml
file.
A docker-compose.yaml
file defines a set of services that will be started as docker containers and how that will happen: from which image, what command, environment variables and files to mount from host, how will be exposed to the network.
To start one setup after a fresh clone is always enough to run docker-compose up
and start the relative docker-compose.yaml
.
You can either run docker-compose up
from the subfolder containing the docker-compose.yaml
you want to start or just passing the path to a specific docker-compose.yaml
from the root of the repository.
For example this will start a sharded cluster:
docker-compose -f sharded/docker-compose.yaml up
NOTE: VSCode and other IDEs have extension and support for docker compose, you should be able to start a setup directly from the editor.
Please also refer to the official documentation (Getting Started, Cli Reference, YAML Reference) and the many other resources online for details on how to use docker-compose
.
const createTestEnvironments = require('@mongodb-js/devtools-docker-test-envs');
const testEnvironments = createTestEnvironments(['...', 'sharded', '...']);
before(async () => {
await testEnvironments.start();
});
it('can connect to sharded cluster', () => {
const { connectionString } = testEnvironments.getConnectionOptions('sharded');
await MongoClient.connect(connectionString);
});
after(async () => {
await testEnvironments.stop();
});
Informations on how to connect are available for each setup.
Some of the setups reqiuire entries on the /etc/hosts
file (or similar in Windows). That is necessary to simulate specific scenarios in the network (for example kerberos realms).
In order to make sure we are actually restarting and using the new
environment for example after changing some of the settings or pulling from main
it can be useful to perform stop and start docker-compose
in a way that
cleans up old resurces.
This can be done running the following commands:
docker-compose down \
-v \ # also removes volumes
--remove-orphans # removes renamed or deleted services
docker-compose up \
--remove-orphans # removes renamed or deleted services
--force-recreate # does not recycle already running containers
Some of the images are built from directories rather than being downloaded from a docker registry.
Normally docker-compose up
will build all the necessary images automatically and cache them
to avoid re-building all the time.
Passing --build
will tell docker-compose
to rebuild images and to pick up changes in the Dockerfile
of the images.
Sometimes however a Dockerfile
would use external scripts or files as part of the build, in such case docker-compose up --build
will not detect any change and we need to force a complete rebuild.
To force a rebuild of an image for a service in docker-compose
we need to run docker-compose build --no-cache <service-name>
, for example:
docker-compose -f kerberos/docker-compose.yaml build --no-cache mongodb
FAQs
DevTools Team docker images and environments for testing
The npm package @mongodb-js/devtools-docker-test-envs receives a total of 8,481 weekly downloads. As such, @mongodb-js/devtools-docker-test-envs popularity was classified as popular.
We found that @mongodb-js/devtools-docker-test-envs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 33 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 phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.