{"id":28493077,"url":"https://github.com/hhftechnology/alpine-mariadb","last_synced_at":"2025-12-31T14:43:17.771Z","repository":{"id":267592967,"uuid":"901189429","full_name":"hhftechnology/alpine-mariadb","owner":"hhftechnology","description":"MariaDB running on Alpine Linux [Docker]","archived":false,"fork":false,"pushed_at":"2024-12-20T05:28:52.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T09:07:22.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hhftechnology.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T07:50:54.000Z","updated_at":"2024-12-20T05:28:56.000Z","dependencies_parsed_at":"2024-12-11T08:48:19.153Z","dependency_job_id":null,"html_url":"https://github.com/hhftechnology/alpine-mariadb","commit_stats":null,"previous_names":["hhftechnology/alpine-mariadb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hhftechnology/alpine-mariadb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhftechnology%2Falpine-mariadb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhftechnology%2Falpine-mariadb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhftechnology%2Falpine-mariadb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhftechnology%2Falpine-mariadb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhftechnology","download_url":"https://codeload.github.com/hhftechnology/alpine-mariadb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhftechnology%2Falpine-mariadb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264200777,"owners_count":23571833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T09:07:25.575Z","updated_at":"2025-12-31T14:43:17.729Z","avatar_url":"https://github.com/hhftechnology.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alpine MariaDB Container\n\n[![Docker Automated build](https://img.shields.io/docker/automated/hhftechnology/alpine-mariadb.svg?style=for-the-badge\u0026logo=docker)](https://hub.docker.com/r/hhftechnology/alpine-mariadb/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/hhftechnology/alpine-mariadb.svg?style=for-the-badge\u0026logo=docker)](https://hub.docker.com/r/hhftechnology/alpine-mariadb/)\n[![Alpine Version](https://img.shields.io/badge/Alpine%20version-v3.20.2-green.svg?style=for-the-badge\u0026logo=alpine-linux)](https://alpinelinux.org/)\n[![MariaDB Version](https://img.shields.io/badge/Mariadb%20version-v10.11.8-green.svg?style=for-the-badge\u0026logo=mariadb)](https://mariadb.org/)\n\n[![Build ad Deploy Alpine MariaDB](https://github.com/hhftechnology/alpine-mariadb/actions/workflows/main.yml/badge.svg)](https://github.com/hhftechnology/alpine-mariadb/actions/workflows/main.yml)\n\nA lightweight MariaDB container based on Alpine Linux, optimized for production deployments with multi-architecture support.\n\n## Technical Specifications\n\n- **Base Image**: Alpine Linux 3.20.2\n- **Database Engine**: MariaDB 10.11.8\n- **Image Size**: Optimized for minimal footprint\n- **Default Character Set**: utf8mb4\n- **Default Collation**: utf8mb4_general_ci\n\n## Supported Architectures\n\n- `amd64`/`x86_64`: 64-bit Intel/AMD\n- `arm64v8`/`aarch64`: 64-bit ARM (ARMv8)\n- `arm32v7`/`armhf`: 32-bit ARM (ARMv7)\n\n## Container Configuration\n\n### Volume Mount Points\n- `/var/lib/mysql`: Database files and data persistence\n- `/var/lib/mysql/mysql-bin`: Binary logs\n- `/etc/my.cnf.d/`: Custom configuration files\n\n### Network Ports\n- `3306`: Default MariaDB port (TCP)\n\n### Environment Variables\n\n#### Required Variables\n- `MYSQL_ROOT_PASSWORD`: Root user password\n- `MYSQL_DATABASE`: Name of the default database\n- `MYSQL_USER`: Application user username\n- `MYSQL_PASSWORD`: Application user password\n\n#### Optional Variables\n- `MYSQL_CHARSET`: Database character set (default: utf8mb4)\n- `MYSQL_COLLATION`: Database collation (default: utf8mb4_general_ci)\n\n## Deployment Examples\n\n### Basic Docker Run\n```bash\ndocker run -d \\\n  --name mariadb \\\n  -p 3306:3306 \\\n  -v mariadb_data:/var/lib/mysql \\\n  -e MYSQL_ROOT_PASSWORD=secure_root_password \\\n  -e MYSQL_DATABASE=appdb \\\n  -e MYSQL_USER=appuser \\\n  -e MYSQL_PASSWORD=secure_user_password \\\n  hhftechnology/alpine-mariadb:latest\n```\n\n### Docker Compose Configuration\n```yaml\nversion: '3.8'\n\nservices:\n  mariadb:\n    image: hhftechnology/alpine-mariadb:latest\n    environment:\n      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}\n      MYSQL_DATABASE: ${MYSQL_DATABASE}\n      MYSQL_USER: ${MYSQL_USER}\n      MYSQL_PASSWORD: ${MYSQL_PASSWORD}\n      MYSQL_CHARSET: utf8mb4\n      MYSQL_COLLATION: utf8mb4_general_ci\n    volumes:\n      - mariadb_data:/var/lib/mysql\n      - ./custom.cnf:/etc/my.cnf.d/custom.cnf:ro\n    ports:\n      - \"3306:3306\"\n    healthcheck:\n      test: [\"CMD\", \"mysqladmin\", \"ping\", \"-h\", \"localhost\"]\n      interval: 10s\n      timeout: 5s\n      retries: 5\n    restart: unless-stopped\n\nvolumes:\n  mariadb_data:\n    driver: local\n```\n\n### Docker Swarm Deployment\n```bash\n# Create required secrets\necho \"secure_root_password\" | docker secret create MYSQL_ROOT_PASSWORD -\necho \"appdb\" | docker secret create MYSQL_DATABASE -\necho \"appuser\" | docker secret create MYSQL_USER -\necho \"secure_user_password\" | docker secret create MYSQL_PASSWORD -\n\n# Deploy the service\ndocker service create \\\n  --name mariadb \\\n  --secret MYSQL_ROOT_PASSWORD \\\n  --secret MYSQL_DATABASE \\\n  --secret MYSQL_USER \\\n  --secret MYSQL_PASSWORD \\\n  --mount type=volume,source=mariadb_data,target=/var/lib/mysql \\\n  -e MYSQL_ROOT_PASSWORD_FILE=/run/secrets/MYSQL_ROOT_PASSWORD \\\n  -e MYSQL_DATABASE_FILE=/run/secrets/MYSQL_DATABASE \\\n  -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER \\\n  -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD \\\n  --replicas 1 \\\n  hhftechnology/alpine-mariadb:latest\n```\n\n## Performance Tuning\n\n### InnoDB Configuration\nAdd custom InnoDB settings in `/etc/my.cnf.d/mariadb-server.cnf`:\n\n```ini\n[mysqld]\ninnodb_buffer_pool_size = 1G\ninnodb_log_file_size = 256M\ninnodb_flush_log_at_trx_commit = 2\ninnodb_flush_method = O_DIRECT\n```\n\n### Connection Pool Settings\n```ini\n[mysqld]\nmax_connections = 500\nthread_cache_size = 128\n```\n\n## Database Initialization\n\nThe container automatically executes the following during first startup:\n1. `.sh` scripts in `/docker-entrypoint-initdb.d/`\n2. `.sql` files in `/docker-entrypoint-initdb.d/`\n3. `.sql.gz` files in `/docker-entrypoint-initdb.d/`\n\nFiles are executed in alphabetical order.\n\n## Backup and Restore\n\n### Backup\n```bash\ndocker exec mariadb \\\n  mysqldump -u root -p${MYSQL_ROOT_PASSWORD} \\\n  --all-databases --single-transaction \\\n  | gzip \u003e backup_$(date +%Y%m%d).sql.gz\n```\n\n### Restore\n```bash\ngunzip \u003c backup.sql.gz | docker exec -i mariadb \\\n  mysql -u root -p${MYSQL_ROOT_PASSWORD}\n```\n\n## Character Set Support\n\nSupports all MariaDB character sets and collations. To change defaults:\n\n```bash\ndocker run -d \\\n  --name mariadb \\\n  -e MYSQL_ROOT_PASSWORD=secure_password \\\n  hhftechnology/alpine-mariadb:latest \\\n  --character-set-server=utf8mb4 \\\n  --collation-server=utf8mb4_unicode_ci\n```\n\n## Security Considerations\n\n1. Always use secrets management in production\n2. Regularly update to the latest version\n3. Use custom configuration to disable unused features\n4. Implement network security policies\n5. Regular backup scheduling\n6. Monitor binary logs\n7. Use SSL for remote connections\n\n## Monitoring \u0026 Logging\n\n- Container logs: `docker logs mariadb`\n- MariaDB error log: `/var/lib/mysql/error.log`\n- Slow query log: `/var/lib/mysql/slow-query.log`\n- Binary logs: `/var/lib/mysql/mysql-bin.*`\n\n## Support \u0026 Contributing\n\n- Issues: [GitHub Issues](https://github.com/hhftechnology/alpine-mariadb/issues)\n- Forum: [HHF Technology Forum](https://forum.hhf.technology)\n- Contribute: Submit PRs to our [GitHub repository](https://github.com/hhftechnology/alpine-mariadb)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhftechnology%2Falpine-mariadb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhftechnology%2Falpine-mariadb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhftechnology%2Falpine-mariadb/lists"}