create data-container
#
OverviewIn order to Spawn a database to work against, you'll need to create a data container. A data container is created from a data image.
#
LifetimeYou can specify a lifetime for a data container via the lifetime
flag. This will automatically delete your data container after the time specified, in time duration format (number followed by a unit suffix. Valid units are "h", "m", "s").
If no value is provided, your data container will have an unlimited lifetime, and will only be deleted if you explicitly request it.
You can update data containers after creation to alter their lifetime
#
Command#
TutorialIn this tutorial we will create a data image and then use it to create a data container.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yaml
with your data image specifications.In this case we want to create a PostgreSQL data image that is completely empty and is named
dev
.Run the following command to create a data image.
You can verify your data image by running the following command.
Create a data container from the newly created data image.
You can verify your data container was properly created by running the following command.
You should now be able to connect to your database and execute queries.
In this example we connect to the PostgreSQL data container (database) using psql.