In order for Spawn to create a database to work against, you'll first need to create a Data Image.
For more information about Data Images please see Data Image concepts
You can specify a lifetime for a Data Image via the
lifetime flag. This will automatically delete your Data Image 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 Image will have an unlimited lifetime, and will only be deleted if you explicitly request it.
If there are Data Containers running for the expired Data Image, the Data Image will not be removed
You can update Data Images after creation to alter their lifetime
$ spawnctl create data-image -f ./development.yaml
To override any Tags specified in the
yaml file, use the
$ spawnctl create data-image -f ./development.yaml --tag v1.0
To override the name specified in the
.yaml file, use the
$ spawnctl create data-image -f ./development.yaml --name new-name
To create a data-image with a
lifetime define it in the
.yaml file or use
$ spawnctl create data-image -f ./development.yaml --lifetime 48h
In this tutorial we will create a Data Image.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yamlwith your Data Image specifications.
sourceType: empty name: dev engine: postgresql version: 11.0
In this case we want to create a PostgreSQL Data Image that is completely empty and is named
Interested in other engines? Go here to see how you can use other engines we support.
Run the following command to create a Data Image.
$ spawnctl create data-image -f ./development.yaml Data image 'dev' created!
You can verify your Data Image by running the following command.
$ spawnctl get data-images NAME IMAGE ID ENGINE STATUS MESSAGE CREATED dev 10001 PostgreSQL 2 Created 2 minutes ago