In this post I will guide you on how we can enable Snap Crator backups for Database running within a container.

What is Snap Creator?

Snap Creator is a tool which provides a CLI and GUI and helps you take consistent backups of your applications and or databases.

More infor:




We will use MySQL DB as a sample for this post.


How do you make sure  mysql data is stored  in a NetApp volume?

Make sure you mount your NetApp Volume on the Docker Server @ /mnt/mysql_data or at a location of your choice

e.g. >sudo mount -t nfs svm_ip:/mysql_data_vol /mnt/mysql_data


How can I start a Container with MySQL?

You can simply run latest mysql database version in a container with following command:

>docker run –name some-mysql -v /mnt/mysql_data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest

Note the -v option and how we give the volume.




How do we enable MySQL backup?

To enable backup of MySQL Database we need to make sure Snap Creator Agent is running in the container.


Steps to enable Snap Creator Agent within the MySQL Container:

1) Install Snap Creator server and agent on the Docker host. (I installed it at /software/snapcreator/)

2) Install docker-compose

>sudo curl -L`uname -s`-`uname -m` > /usr/local/bin/docker-compose
>sudo chmod +x /usr/local/bin/docker-compose

2) Find Snap Creator Agent under : /software/snapcreator/scAgent4.1.2

3) Create a new entrypoint file for our Docker Container:


#! /bin/bash
echo “running sc agent “
/etc/netapp/snapcreator/scAgent4.1.2/bin/scAgent start
echo “running old entrypoint with args”
/ “$@”


4) Create a new DockerFile to build our MySQL container with SC Agent enabled

File: DockerFile:


FROM mysql:latest
RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless
CMD [“mysqld”]


5) Put both the files Dockerfile and under a folder named mysql-image

6) Create a new docker-compose file

File: docker-compose.yml

build: mysql-image

– “9090:9090”

– “3306:3306”
– /mnt/mysql_data_prod:/var/lib/mysql
– /software/snapcreator/scAgent4.1.2:/etc/netapp/snapcreator/scAgent4.1.2
SCAGENT_HOME: /etc/netapp/snapcreator/scAgent4.1.2


7) Run the following:

> docker-compose build

>docker-compose up -d


8) Now your MySQL Container will start with SC Agent running on port 9090 which is exposed also on the docker host at 9090,(which is configurable in the docker-compose.yml file)

9) Now start Snap Creator Server and create a new config for your MySQl database as usual.


Sample code available here: