Alpine image with MySQL 5 client and AWS CLI for backups and automation tasks.
10K+
A minimal Docker image based on Alpine Linux 3.21 with:
mysql)aws)Ideal for database dumps, backups to S3, and CLI-based workflows in CI/CD or Kubernetes CronJobs.
| Tool | Version |
|---|---|
| Alpine Linux | 3.21 |
| MySQL Client | 5.x |
| AWS CLI | v2.x |
docker pull chusri/mysql-client-awscli:alpine-3.21
docker run --rm \
-e AWS_ACCESS_KEY_ID=xxx \
-e AWS_SECRET_ACCESS_KEY=yyy \
chusri/mysql-client-awscli:alpine-3.21 \
sh -c 'mysqldump -h your-db-host -u your-user -pYOUR_PASSWORD your_db \
| gzip | aws s3 cp - s3://your-bucket/mysql-backup.sql.gz'
You can use this image directly in a Kubernetes CronJob to backup your MySQL database to S3.
โฐ Runs daily at 2:00 AM
๐พ Dumps database โ compresses withgzipโ uploads tos3://your-s3-bucket/
apiVersion: batch/v1
kind: CronJob
metadata:
name: mysql-backup-job
spec:
schedule: "0 2 * * *" # Runs daily at 2:00 AM
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: chusri/mysql-client-awscli:alpine-3.21
env:
- name: MYSQL_HOST
value: "your-mysql-host"
- name: MYSQL_USER
value: "your-username"
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secret
key: password
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: aws-secret
key: access_key
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: aws-secret
key: secret_key
args:
- sh
- -c
- |
mysqldump -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD your_db \
| gzip \
| aws s3 cp - s3://your-s3-bucket/mysql-backup-$(date +\%F).sql.gz
restartPolicy: OnFailure
apiVersion: v1
kind: Secret
metadata:
name: mysql-secret
type: Opaque
stringData:
password: your_mysql_password
---
apiVersion: v1
kind: Secret
metadata:
name: aws-secret
type: Opaque
stringData:
access_key: your_aws_access_key
secret_key: your_aws_secret_key
docker build -t chusri/mysql-client-awscli:alpine-3.21 .
This project is licensed under the MIT License. See the LICENSEโ file for details.
Content type
Image
Digest
sha256:7a43ebf93โฆ
Size
49.2 MB
Last updated
over 1 year ago
docker pull chusri/mysql-client-awscli