.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
#Build example where docker build command root folder is the git repository root older
|
#check ../README.md for more information
|
||||||
#docker build -t duplicati-sqlclient:latest -f ./docker/sqlclient/Dockerfile .
|
|
||||||
|
|
||||||
FROM duplicati/duplicati
|
FROM duplicati/duplicati
|
||||||
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
|
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
# Duplicati / mySql Client
|
# Duplicati / mySql Client
|
||||||
|
|
||||||
## Build
|
Using option run-script-before-required on duplicati job set value to /duplicati-mysqlclient/scripts/backupdb.sh.
|
||||||
|
And job will create a database dump configured using docker environment variables
|
||||||
|
|
||||||
|
## Build Image
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#example where docker root folder build command is the git repository root folder
|
#Executed on repository root folder
|
||||||
docker build -t duplicati-sqlclient:latest -f ./docker/sqlclient/Dockerfile .
|
#docker build -t duplicati-sqlclient:latest -f docker/sqlclient/Dockerfile .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Portainer
|
### Portainer
|
||||||
@@ -13,9 +16,34 @@ Images -> Build a new Image -> URL
|
|||||||
|
|
||||||
**Name**:duplicati-sqlclient:latest
|
**Name**:duplicati-sqlclient:latest
|
||||||
|
|
||||||
|
|
||||||
**URL:**
|
**URL:**
|
||||||
https://git.limbosolutions.com/kb/duplicati.git
|
https://git.limbosolutions.com/kb/duplicati.git
|
||||||
|
|
||||||
**Dockerfile path:**
|
**Dockerfile path:**
|
||||||
/docker/sqlclient/Dockerfile
|
/docker/sqlclient/Dockerfile
|
||||||
|
|
||||||
|
## Run Container
|
||||||
|
|
||||||
|
### Docker Compose
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
duplicati:
|
||||||
|
image: duplicati-sqlclient
|
||||||
|
environment:
|
||||||
|
- MYSQL_HOST=${MYSQL_HOST}
|
||||||
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- DESTINATION=/db-dumps
|
||||||
|
volumes:
|
||||||
|
- duplicati-data:/data
|
||||||
|
- db-dumps:/db-dumps
|
||||||
|
ports:
|
||||||
|
- 8200:8200
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
duplicati-data:
|
||||||
|
db-dumps:
|
||||||
|
````
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# MYSQL_HOST
|
# MYSQL_HOST
|
||||||
# MYSQL_USER
|
# MYSQL_USER
|
||||||
# MYSQL_PASSWORD
|
# MYSQL_PASSWORD
|
||||||
# MYSQL_NAME
|
# MYSQL_DATABASE
|
||||||
# download directly from git
|
# download directly from git
|
||||||
# curl https://git.limbosolutions.com/kb/duplicati/raw/branch/main/docker/scripts/backupdb.sh > backupdb.sh | chmod +x backupdb.sh
|
# curl https://git.limbosolutions.com/kb/duplicati/raw/branch/main/docker/scripts/backupdb.sh > backupdb.sh | chmod +x backupdb.sh
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
mysqldump -h ${MYSQL_HOST} --user=${MYSQL_USER} -p"${MYSQL_PASSWORD}" ${MYSQL_NAME} > /tmp/${TARGETFILENAME}
|
mysqldump -h ${MYSQL_HOST} --user=${MYSQL_USER} -p"${MYSQL_PASSWORD}" ${MYSQL_DATABASE} > /tmp/${TARGETFILENAME}
|
||||||
|
|
||||||
|
|
||||||
if [ x$(find "$DESTINATION" -prune -empty) = x"$DESTINATION" ]; then
|
if [ x$(find "$DESTINATION" -prune -empty) = x"$DESTINATION" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user