10.1.24-r2 release

- Removes the `VOLUME` instruction from the `Dockerfile`
This commit is contained in:
Bitnami Bot 2017-06-26 09:29:18 +00:00
parent 3991224a8e
commit 3ea1df5e5a
3 changed files with 85 additions and 162 deletions

View File

@ -11,7 +11,7 @@ COPY rootfs /
ENV ALLOW_EMPTY_PASSWORD="no" \
BITNAMI_APP_NAME="mariadb" \
BITNAMI_IMAGE_VERSION="10.1.24-r1" \
BITNAMI_IMAGE_VERSION="10.1.24-r2" \
MARIADB_DATABASE="" \
MARIADB_MASTER_HOST="" \
MARIADB_MASTER_PORT_NUMBER="" \
@ -29,7 +29,6 @@ ENV ALLOW_EMPTY_PASSWORD="no" \
VOLUME ["/bitnami/mariadb"]
EXPOSE 3306

View File

@ -8,7 +8,7 @@ services:
ports:
- '3306:3306'
volumes:
- 'mariadb_data:/bitnami/mariadb'
- 'mariadb_data:/bitnami'
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes

View File

@ -10,31 +10,24 @@
# TL;DR;
```bash
docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes bitnami/mariadb:latest
```console
$ docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes bitnami/mariadb:latest
```
## Docker Compose
```yaml
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '3306:3306'
```console
$ curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-mariadb/master/docker-compose.yml > docker-compose.yml
$ docker-compose up -d
```
## Kubernetes
> **WARNING:** This is a beta configuration, currently unsupported.
Get the raw URL pointing to the kubernetes.yml manifest and use kubectl to create the resources on your Kubernetes cluster like so:
Get the raw URL pointing to the `kubernetes.yml` manifest and use `kubectl` to create the resources on your Kubernetes cluster like so:
```bash
```console
$ kubectl create -f https://raw.githubusercontent.com/bitnami/bitnami-docker-mariadb/master/kubernetes.yml
```
@ -50,36 +43,35 @@ $ kubectl create -f https://raw.githubusercontent.com/bitnami/bitnami-docker-mar
The recommended way to get the Bitnami MariaDB Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/bitnami/mariadb).
```bash
docker pull bitnami/mariadb:latest
```console
$ docker pull bitnami/mariadb:latest
```
To use a specific version, you can pull a versioned tag. You can view the
[list of available versions](https://hub.docker.com/r/bitnami/mariadb/tags/)
in the Docker Hub Registry.
```bash
docker pull bitnami/mariadb:[TAG]
```console
$ docker pull bitnami/mariadb:[TAG]
```
If you wish, you can also build the image yourself.
```bash
docker build -t bitnami/mariadb:latest https://github.com/bitnami/bitnami-docker-mariadb.git
```console
$ docker build -t bitnami/mariadb:latest https://github.com/bitnami/bitnami-docker-mariadb.git
```
# Persisting your database
If you remove the container all your data and configurations will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.
**Note!**
If you have already started using your database, follow the steps on
[backing up](#backing-up-your-container) and [restoring](#restoring-a-backup) to pull the data from your running container down to your host.
For persistence of the MariaDB server data you should mount a directory at the `/bitnami` path. If the mounted directory is empty, it will be initialized on the first run.
The image exposes a volume at `/bitnami/mariadb` for the MariaDB data and configurations. For persistence you can mount a directory at this location from your host. If the mounted directory is empty, it will be initialized on the first run.
```bash
docker run -v /path/to/mariadb-persistence:/bitnami/mariadb bitnami/mariadb:latest
```console
$ docker run \
-e ALLOW_EMPTY_PASSWORD=yes \
-v /path/to/mariadb-persistence:/bitnami \
bitnami/mariadb:latest
```
or using Docker Compose:
@ -95,7 +87,7 @@ services:
ports:
- '3306:3306'
volumes:
- /path/to/mariadb-persistence:/bitnami/mariadb
- /path/to/mariadb-persistence:/bitnami
```
# Connecting to other containers
@ -110,7 +102,7 @@ In this example, we will create a MariaDB client instance that will connect to t
### Step 1: Create a network
```bash
```console
$ docker network create app-tier --driver bridge
```
@ -118,7 +110,7 @@ $ docker network create app-tier --driver bridge
Use the `--network app-tier` argument to the `docker run` command to attach the MariaDB container to the `app-tier` network.
```bash
```console
$ docker run -d --name mariadb-server \
-e ALLOW_EMPTY_PASSWORD=yes \
--network app-tier \
@ -129,7 +121,7 @@ $ docker run -d --name mariadb-server \
Finally we create a new container instance to launch the MariaDB client and connect to the server created in the previous step:
```bash
```console
$ docker run -it --rm \
--network app-tier \
bitnami/mariadb:latest mysql -h mariadb-server -u root
@ -166,7 +158,7 @@ services:
Launch the containers using:
```bash
```console
$ docker-compose up -d
```
@ -181,8 +173,8 @@ The root user and password can easily be setup with the Bitnami MariaDB Docker i
Passing the `MARIADB_ROOT_PASSWORD` environment variable when running the image for the first time will set the password of the `MARIADB_ROOT_USER` user to the value of `MARIADB_ROOT_PASSWORD`.
```bash
docker run --name mariadb -e MARIADB_ROOT_PASSWORD=password123 bitnami/mariadb:latest
```console
$ docker run --name mariadb -e MARIADB_ROOT_PASSWORD=password123 bitnami/mariadb:latest
```
or using Docker Compose:
@ -205,8 +197,8 @@ services:
By default the MariaDB image expects all the available passwords to be set. In order to allow empty passwords, it is necessary to set the `ALLOW_EMPTY_PASSWORD=yes` env variable. This env variable is only recommended for testing or development purposes. We strongly recommend specifying the `MARIADB_ROOT_PASSWORD` for any other scenario.
```bash
docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes bitnami/mariadb:latest
```console
$ docker run --name mariadb -e ALLOW_EMPTY_PASSWORD=yes bitnami/mariadb:latest
```
or using Docker Compose:
@ -227,8 +219,8 @@ services:
By passing the `MARIADB_DATABASE` environment variable when running the image for the first time, a database will be created. This is useful if your application requires that a database already exists, saving you from having to manually create the database using the MySQL client.
```bash
docker run --name mariadb -e MARIADB_DATABASE=my_database bitnami/mariadb:latest
```console
$ docker run --name mariadb -e MARIADB_DATABASE=my_database bitnami/mariadb:latest
```
or using Docker Compose:
@ -250,8 +242,8 @@ services:
You can create a restricted database user that only has permissions for the database created with the [`MARIADB_DATABASE`](#creating-a-database-on-first-run) environment variable. To do this, provide the `MARIADB_USER` environment variable and to set a password for the database user provide the `MARIADB_PASSWORD` variable.
```bash
docker run --name mariadb \
```console
$ docker run --name mariadb \
-e ALLOW_EMPTY_PASSWORD=yes \
-e MARIADB_USER=my_user \
-e MARIADB_PASSWORD=my_password \
@ -296,8 +288,8 @@ In a replication cluster you can have one master and zero or more slaves. When r
The first step is to start the MariaDB master.
```bash
docker run --name mariadb-master \
```console
$ docker run --name mariadb-master \
-e MARIADB_ROOT_PASSWORD=master_root_password \
-e MARIADB_REPLICATION_MODE=master \
-e MARIADB_REPLICATION_USER=my_repl_user \
@ -314,8 +306,8 @@ In the above command the container is configured as the `master` using the `MARI
Next we start a MariaDB slave container.
```bash
docker run --name mariadb-slave --link mariadb-master:master \
```console
$ docker run --name mariadb-slave --link mariadb-master:master \
-e MARIADB_REPLICATION_MODE=slave \
-e MARIADB_REPLICATION_USER=my_repl_user \
-e MARIADB_REPLICATION_PASSWORD=my_repl_password \
@ -339,7 +331,7 @@ services:
ports:
- '3306'
volumes:
- /path/to/mariadb-persistence:/bitnami/mariadb
- /path/to/mariadb-persistence:/bitnami
environment:
- MARIADB_REPLICATION_MODE=master
- MARIADB_REPLICATION_USER=repl_user
@ -365,8 +357,8 @@ services:
Scale the number of slaves using:
```bash
docker-compose scale mariadb-master=1 mariadb-slave=3
```console
$ docker-compose scale mariadb-master=1 mariadb-slave=3
```
The above command scales up the number of slaves to `3`. You can scale down in the same manner.
@ -375,28 +367,21 @@ The above command scales up the number of slaves to `3`. You can scale down in t
## Configuration file
The image looks for configuration in the `conf/` directory of `/bitnami/mariadb`. As mentioned in [Persisting your database](#persisting-your-data) you can mount a volume at this location and copy your own custom `my_custom.cnf` file in the `conf/` directory. That file will be included in the main configuration file and will overwrite any configuration you want to modify.
The image looks for user-defined configurations in `/bitnami/mariadb/conf/my_custom.cnf`. Create a file named `my_custom.cnf` and mount it at `/bitnami/mariadb/conf/my_custom.cnf`.
For example, in order to override the max_allowed_packet directive:
For example, in order to override the `max_allowed_packet` directive:
# Step 1: Write your my_custom.cnf file with the following content.
```
# Step 1: Write your `my_custom.cnf` file with the following content.
```config
[mysqld]
max_allowed_packet=32M
```
# Step 2: Run the mariaDB image with the designed volume attached.
```
docker run --name mariadb -v /path/to/my_custom_cnf_directory:/bitnami/mariadb bitnami/mariadb:latest
```
After that, your changes will be taken into account in the server's behaviour.
### Step 1: Run the MariaDB image
Run the MariaDB image, mounting a directory from your host.
```bash
docker run --name mariadb -v /path/to/mariadb-persistence:/bitnami/mariadb bitnami/mariadb:latest
```console
$ docker run --name mariadb -v /path/to/my_custom.cnf:/bitnami/mariadb/conf/my_custom.cnf:ro bitnami/mariadb:latest
```
or using Docker Compose:
@ -412,117 +397,41 @@ services:
ports:
- '3306:3306'
volumes:
- /path/to/mariadb-persistence:/bitnami/mariadb
- /path/to/my_custom.cnf:/bitnami/mariadb/conf/my_custom.cnf:ro
```
### Step 2: Edit the configuration
After that, your changes will be taken into account in the server's behaviour.
Edit the configuration on your host using your favorite editor.
As mentioned in [Persisting your database](#persisting-your-database) if you mount a volume at `/bitnami`, you could copy `my_custom.cnf` at `/path/to/mariadb-persistence/mariadb/conf/my_custom.cnf` or even edit the `/path/to/mariadb-persistence/mariadb/conf/my.cnf` file.
```bash
vi /path/to/mariadb-persistence/conf/my.cnf
```
### Step 3: Restart MariaDB
After changing the configuration, restart your MariaDB container for changes to take effect.
```bash
docker restart mariadb
```
or using Docker Compose:
```bash
docker-compose restart mariadb
```
**Further Reading:**
- [Server Option and Variable Reference](https://dev.mysql.com/doc/refman/5.1/en/mysqld-option-tables.html)
Refer to the [MySQL server option and variable reference guide](https://dev.mysql.com/doc/refman/5.1/en/mysqld-option-tables.html) for the complete list of configuration options.
# Logging
The Bitnami MariaDB Docker image sends the container logs to the `stdout`. To view the logs:
```bash
docker logs mariadb
```console
$ docker logs mariadb
```
or using Docker Compose:
```bash
docker-compose logs mariadb
```console
$ docker-compose logs mariadb
```
You can configure the containers [logging driver](https://docs.docker.com/engine/admin/logging/overview/) using the `--log-driver` option if you wish to consume the container logs differently. In the default configuration docker uses the `json-file` driver.
# Maintenance
## Backing up your container
To backup your data, configuration and logs, follow these simple steps:
### Step 1: Stop the currently running container
```bash
docker stop mariadb
```
or using Docker Compose:
```bash
docker-compose stop mariadb
```
### Step 2: Run the backup command
We need to mount two volumes in a container we will use to create the backup: a directory on your host to store the backup in, and the volumes from the container we just stopped so we can access the data.
```bash
docker run --rm -v /path/to/mariadb-backups:/backups --volumes-from mariadb busybox \
cp -a /bitnami/mariadb:latest /backups/latest
```
or using Docker Compose:
```bash
docker run --rm -v /path/to/mariadb-backups:/backups --volumes-from `docker-compose ps -q mariadb` busybox \
cp -a /bitnami/mariadb:latest /backups/latest
```
## Restoring a backup
Restoring a backup is as simple as mounting the backup as volumes in the container.
```bash
docker run -v /path/to/mariadb-backups/latest:/bitnami/mariadb bitnami/mariadb:latest
```
or using Docker Compose:
```yaml
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '3306:3306'
volumes:
- /path/to/mariadb-backups/latest:/bitnami/mariadb
```
## Upgrade this image
Bitnami provides up-to-date versions of MariaDB, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container.
### Step 1: Get the updated image
```bash
docker pull bitnami/mariadb:latest
```console
$ docker pull bitnami/mariadb:latest
```
or if you're using Docker Compose, update the value of the image property to
@ -530,38 +439,53 @@ or if you're using Docker Compose, update the value of the image property to
### Step 2: Stop and backup the currently running container
Before continuing, you should backup your container's data, configuration and logs.
Stop the currently running container using the command
Follow the steps on [creating a backup](#backing-up-your-container).
```console
$ docker stop mariadb
```
or using Docker Compose:
```console
$ docker-compose stop mariadb
```
Next, take a snapshot of the persistent volume `/path/to/mariadb-persistence` using:
```console
$ rsync -a /path/to/mariadb-persistence /path/to/mariadb-persistence.bkp.$(date +%Y%m%d-%H.%M.%S)
```
### Step 3: Remove the currently running container
```bash
docker rm -v mariadb
```console
$ docker rm -v mariadb
```
or using Docker Compose:
```bash
docker-compose rm -v mariadb
```console
$ docker-compose rm -v mariadb
```
### Step 4: Run the new image
Re-create your container from the new image, [restoring your backup](#restoring-a-backup) if necessary.
Re-create your container from the new image.
```bash
docker run --name mariadb bitnami/mariadb:latest
```console
$ docker run --name mariadb bitnami/mariadb:latest
```
or using Docker Compose:
```bash
docker-compose start mariadb
```console
$ docker-compose start mariadb
```
# Notable Changes
## 10.1.21-r2
- `MARIADB_MASTER_USER` has been renamed to `MARIADB_MASTER_ROOT_USER`
@ -597,7 +521,7 @@ Discussions are archived at [bitnami-oss.slackarchive.io](https://bitnami-oss.sl
# License
Copyright (c) 2015-2016 Bitnami
Copyright (c) 2015-2017 Bitnami
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.