MXS-1803: Simplify docker image

The docker image now simply installs the latest MaxScale version instead
of building it. This significantly reduces the amount of maintenance that
the image requires.

Updated the configurations to allow runtime definition of servers and
updated README.md to reflect the changes in the files. Pointed links to
2.2 instead of develop. Removed text from the readme that was not strictly
related to running the MaxScale image.
This commit is contained in:
Markus Mäkelä
2018-04-16 08:45:14 +03:00
parent 890902e338
commit 41626202ed
4 changed files with 51 additions and 124 deletions

View File

@ -1,53 +1,7 @@
# This Dockerfile builds an image for MariaDB MaxScale:
# https://mariadb.com/products/technology/maxscale
# The example configuration file maxscale.cnf should be in the build directory
# when building the image.
FROM alpine:latest
# Packages required for building MaxScale and Avro-C
ARG DEPENDENCIES_PKGS="bash bison cmake curl flex gcc git gnutls gnutls-dev g++ \
jansson jansson-dev libedit libedit-dev libgcrypt libgcrypt-dev libstdc++ lua \
lua-dev make ncurses ncurses-dev openssl openssl-dev perl sqlite sqlite-dev \
sqlite-libs tcl-dev util-linux-dev xz xz-dev"
# Packages that can be removed after build
ARG REM_PKGS="bison bash cmake flex gcc git gnutls-dev g++ jansson-dev \
libedit-dev libgcrypt-dev lua-dev make ncurses-dev openssl-dev perl sqlite-dev \
tcl-dev xz-dev"
# MaxScale-specific parameters
ARG MS_DIR=/MaxScale_workdir
ARG MS_CMAKE_PARS="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWITH_SCRIPTS=N -DTARGET_COMPONENT=all"
ARG MS_BRANCH=develop
ARG MS_REPO=https://github.com/mariadb-corporation/MaxScale.git
# Avro-specific parameters
ARG AV_DIR=/Avro_workdir
ARG AV_PREF=avro-c-1.8.2
ARG AV_ARCH=$AV_PREF.tar.gz
ARG AV_URL=ftp://ftp.funet.fi/pub/mirrors/apache.org/avro/avro-1.8.2/c/$AV_ARCH
ARG AV_CMAKE_PARS="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC"
RUN apk -U add $DEPENDENCIES_PKGS && \
mkdir $MS_DIR && mkdir $AV_DIR && mkdir $MS_DIR/Build && mkdir $AV_DIR/Build && \
cd $AV_DIR && \
# Download Avro-C, build and install
curl --output $AV_ARCH $AV_URL && \
tar -zxvf $AV_ARCH && cd Build && \
cmake $AV_CMAKE_PARS ../$AV_PREF && \
make install && \
cd $MS_DIR && \
# Download MaxScale, build and install
git clone --depth 1 --branch $MS_BRANCH $MS_REPO && cd Build && \
cmake $MS_CMAKE_PARS ../MaxScale && \
make install && (./postinst || true) && \
# Remove unneeded packages and work directories
apk del $REM_PKGS && \
cd / && rm -rf $MS_DIR $AV_DIR
# Dockerfile for the 2.2 GA version of MariaDB MaxScale
FROM centos:7
RUN curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash && yum -y install maxscale
COPY ./maxscale.cnf /etc/
ENTRYPOINT ["maxscale", "-d"]
ENTRYPOINT ["maxscale", "-d", "-U", "maxscale"]
CMD ["-lstdout"]