You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -d --name mysql8-ci --network "${NET}" \
96
-
-e MYSQL_ROOT_PASSWORD=rootpass \
97
-
-e MYSQL_DATABASE=appdb \
98
-
mysql:8 >/dev/null
99
-
100
-
for i in $(seq 1 90); do
101
-
if docker exec mysql8-ci sh -lc 'mysqladmin ping -h 127.0.0.1 -uroot -prootpass --silent >/dev/null 2>&1'; then
102
-
break
103
-
fi
104
-
sleep 2
105
-
done
106
-
107
-
docker exec mysql8-ci mysql -uroot -prootpass -e "CREATE DATABASE IF NOT EXISTS appdb; USE appdb; CREATE TABLE IF NOT EXISTS ci_items(id INT PRIMARY KEY, val VARCHAR(20)); TRUNCATE ci_items; INSERT INTO ci_items VALUES (1,'one'),(2,'two');" >/dev/null
108
-
109
-
docker run -d --name dbbackup-mysql --network "${NET}" \
110
-
-v "${MYSQL_BACKUP_DIR}:/backup" \
111
-
-e MODE=MANUAL \
112
-
-e CONTAINER_ENABLE_SCHEDULING=FALSE \
113
-
-e CONTAINER_ENABLE_MONITORING=FALSE \
114
-
-e MANUAL_RUN_FOREVER=TRUE \
115
-
-e DB01_TYPE=mysql \
116
-
-e DB01_NAME=appdb \
117
-
-e DB01_HOST=mysql8-ci \
118
-
-e DB01_USER=root \
119
-
-e DB01_PASS=rootpass \
120
-
-e DB01_PORT=3306 \
121
-
-e DB01_BACKUP_LOCATION=FILESYSTEM \
122
-
"${IMAGE}" >/dev/null
123
-
124
-
sleep 10
125
-
docker exec dbbackup-mysql backup-now >/dev/null
126
-
127
-
MYSQL_FILE="$(docker exec dbbackup-mysql sh -lc 'ls -1 /backup/mariadb_appdb_mysql8-ci_*.sql.zst | head -n1 | xargs -n1 basename')"
128
-
test -n "${MYSQL_FILE}"
129
-
130
-
docker exec mysql8-ci mysql -uroot -prootpass -e "DROP DATABASE IF EXISTS restoredb; CREATE DATABASE restoredb;" >/dev/null
-`--build-arg ENABLE_MSSQL_CLIENT=false` (default; enable only if MSSQL backups/restores are needed)
129
+
130
+
Dependency policy notes:
131
+
-`awscli` is pinned in the image build for deterministic S3/MinIO behavior across environments.
132
+
- Optional clients are controlled with build args to reduce attack surface and CVE churn when unused.
128
133
129
134
### Prebuilt Images
130
135
@@ -827,6 +832,15 @@ Manual backups can be performed by entering the container and typing `backup-now
827
832
828
833
- Recently there was a request to run the container with Kubernetes cron scheduling. This can be done by setting `MODE=MANUAL` and `MANUAL_RUN_FOREVER=FALSE` while disabling scheduler features from the upstream base image (`CONTAINER_ENABLE_SCHEDULING=FALSE`). This allows the container to start, execute backups, and then exit cleanly. An alternative way to run the script is `/etc/services.available/10-db-backup/run`.
0 commit comments