All databases run in separate containers but in the same network namespace as the main dev-container ("app") and can therefore be accessed via localhost.
Database runs in a container named "7dbs_devcontainer-postgres-1".
Environment variables, e.g. PGUSER and PGPASSWORD, prepared to match defaults for the database server.
psql
Or after the 7dbs
database has been created (createdb 7dbs
):
psql 7dbs
The contrib content is available in the postgres container image but the extensions must be loaded into the database using CREATE EXTENSION
. So, after connecting to the 7dbs
database, load what you need according to the following example.
CREATE EXTENSION fuzzystrmatch;
Running in "standalone mode" in a container named "7dbs_devcontainer-hbase-1"
The "shell" can be started via docker exec
into container. Convenience aliases are defined to make this easier:
Interactive mode:
hbase-shell
General purpose bash inside the container, e.g run a script file in non-interactive hbase shell:
hbase-bash "cat /workspace/lab/hbase/script.rb | hbase shell -n"
Or just start an interactive bash shell inside the hbase container:
hbase-bash bash
(Note that the repo root's lab/
directory is mounted at /workspace/lab/
inside the container)
Database runs in a container named "7dbs_devcontainer-mongodb-1".
mongosh
Or for a specific database:
mongosh book
The MongoDB for VS Code extension is also available for database interaction.