If you define the
sourceType property as
backup you will be able to create a Data Image whose content will be what you defined in your backup.
sourceType: backup name: dev engine: mysql backup: folder: mybackup file: backup.sql
In this case we want to create a MySQL Data Image whose source is
backup and is named
folderis relative to the location of your
All files found in the
folderwill be uploaded.
In this tutorial we will create a Data Image from
backup and then use it to create a Data Container. We will then inspect the Data Container.
As a prerequisite you should've followed the instructions to install spawnctl
Create a file
development.yamlwith your Data Image specifications.
sourceType: backup name: dev engine: mysql backup: folder: ./mybackup file: backup.sql
We are defining the source of our Data Image to be
backup, the backup folder to be
./mybackupand to base our image on the backup file
Run the following command to create a Data Image.
$ spawnctl create data-image -f ./development.yaml Data image 'dev' created!
Create a Data Container from the newly created Data Image.
$ spawnctl create data-container --image dev Data image 'dev-rambbomj' created!
You should now be able to connect to your database and execute queries.