Skip to content

Commit

Permalink
Add Docker images for MySQL 5.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
enisoc committed May 21, 2016
1 parent dea4eb2 commit 4170be3
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM vitess/bootstrap:mysql56
FROM vitess/bootstrap:mysql57

# Re-copy sources from working tree
USER root
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile.mysql56
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM vitess/bootstrap:mysql56

# Re-copy sources from working tree
USER root
COPY . /vt/src/github.com/youtube/vitess

# Fix permissions
RUN chown -R vitess:vitess /vt
USER vitess

# Build Vitess
RUN make build
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,18 @@ docker_bootstrap:
docker/bootstrap/build.sh common
docker/bootstrap/build.sh mariadb
docker/bootstrap/build.sh mysql56
docker/bootstrap/build.sh mysql57
docker/bootstrap/build.sh percona

docker_base:
# Fix permissions before copying files, to avoid AUFS bug.
chmod -R o=g *
docker build -t vitess/base .

docker_base_mysql56:
chmod -R o=g *
docker build -f Dockerfile.percona -t vitess/base:mysql56 .

docker_base_percona:
chmod -R o=g *
docker build -f Dockerfile.percona -t vitess/base:percona .
Expand All @@ -136,6 +141,9 @@ docker_base_mariadb:
docker_lite:
cd docker/lite && ./build.sh

docker_lite_mysql56:
cd docker/lite && ./build.sh mysql56

docker_lite_mariadb:
cd docker/lite && ./build.sh mariadb

Expand Down
14 changes: 14 additions & 0 deletions docker/bootstrap/Dockerfile.mysql57
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM vitess/bootstrap:common

# Install MySQL 5.7
RUN apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net 5072E1F5 && \
add-apt-repository 'deb http://repo.mysql.com/apt/debian/ jessie mysql-5.7' && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server libmysqlclient-dev && \
rm -rf /var/lib/apt/lists/*

# Bootstrap Vitess
WORKDIR /vt/src/github.com/youtube/vitess
USER vitess
ENV MYSQL_FLAVOR MySQL56
RUN ./bootstrap.sh --skip_root_installs
2 changes: 1 addition & 1 deletion docker/lite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM debian:jessie

# Install dependencies
RUN apt-key adv --recv-keys --keyserver pgp.mit.edu 5072E1F5 \
&& echo 'deb http://repo.mysql.com/apt/debian/ jessie mysql-5.6' > /etc/apt/sources.list.d/mysql.list \
&& echo 'deb http://repo.mysql.com/apt/debian/ jessie mysql-5.7' > /etc/apt/sources.list.d/mysql.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
Expand Down
37 changes: 37 additions & 0 deletions docker/lite/Dockerfile.mysql56
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This image is only meant to be built from within the build.sh script.
FROM debian:jessie

# Install dependencies
RUN apt-key adv --recv-keys --keyserver pgp.mit.edu 5072E1F5 \
&& echo 'deb http://repo.mysql.com/apt/debian/ jessie mysql-5.6' > /etc/apt/sources.list.d/mysql.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
bzip2 \
memcached \
libmysqlclient18 \
mysql-client \
mysql-server \
&& rm -rf /var/lib/apt/lists/*

# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTTOP /vt/src/github.com/youtube/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV VTDATAROOT $VTROOT/vtdataroot
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV LD_LIBRARY_PATH $VTROOT/dist/vt-zookeeper-3.4.6/lib

# Copy binaries (placed by build.sh)
COPY lite/vt /vt

# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess && \
mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt

# Create mount point for actual data (e.g. MySQL data dir)
VOLUME /vt/vtdataroot
2 changes: 1 addition & 1 deletion test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ For example:

// Flags
var (
flavor = flag.String("flavor", "mysql56", "bootstrap flavor to run against")
flavor = flag.String("flavor", "mysql57", "bootstrap flavor to run against")
runCount = flag.Int("runs", 1, "run each test this many times")
retryMax = flag.Int("retry", 3, "max number of retries, to detect flaky tests")
logPass = flag.Bool("log-pass", false, "log test output even if it passes")
Expand Down

0 comments on commit 4170be3

Please sign in to comment.