viernes, 16 de mayo de 2025

Fast forward creation of MongoDB database

 

// Create the database database by switching to it
db = db.getSiblingDB('database');

// Create a test collection to ensure the database is created
// (MongoDB only creates a database when it has content)
db.createCollection('collection');

// Create the user with the specified credentials
db.createUser({
user: "admin",
pwd: "Pass",
roles: [
{ role: "readWrite", db: "database" },
{ role: "dbAdmin", db: "database" }
]
})

viernes, 9 de mayo de 2025

Let's clean up the Docker build cache

Docker build cache is consuming a lot sometime.

Let's clean up the Docker build cache to free up space:


docker system df
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          0         0         0B        0B
Containers      0         0         0B        0B
Local Volumes   0         0         0B        0B
Build Cache     200       0         37.73GB   37.73GB

 

docker builder prune -af