Skip to content

Commit c9d721e

Browse files
committed
Allow building for multiple distro images
We want to be able to run against our build in vitess-private as the MySQL version but we don't run always Debian Bullseye there, a lot is Ubuntu 20.04 right now. This sets up a matrix so we can build with multiple Docker bases and then release tarballs for each version to install in vitess-private CI.
1 parent de79707 commit c9d721e

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.buildkite/pipeline.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ steps:
1919
plugins:
2020
- docker-compose#v3.10.0:
2121
run: builder
22+
env:
23+
DISTRO: "{{matrix}}"
24+
matrix:
25+
- "debian:bullseye-slim"
26+
- "ubuntu:focal"
2227

2328
- wait
2429

Dockerfile.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
FROM debian:bullseye-slim
1+
ARG BASE_IMAGE=debian:bullseye-slim
2+
FROM $BASE_IMAGE
23

34
RUN apt-get update && apt-get upgrade -y
45

56
ENV DEBIAN_FRONTEND noninteractive
7+
ENV DISTRO $BASE_IMAGE
68

79
ADD --chown=1234 . /src
810
WORKDIR /src

Dockerfile.release

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ RUN apt-get update && \
1010
apt-get install -y \
1111
binutils
1212

13-
COPY mysql-${MYSQL_VERSION}-linux-x86_64.tar.gz /dist/
13+
COPY mysql-${MYSQL_VERSION}-bullseye-linux-x86_64.tar.gz /dist/
1414

1515
RUN mkdir /dist/usr && \
16-
tar -xzvf /dist/mysql-${MYSQL_VERSION}-linux-x86_64.tar.gz -C /dist/usr --strip-components=1
16+
tar -xzvf /dist/mysql-${MYSQL_VERSION}-bullseye-linux-x86_64.tar.gz -C /dist/usr --strip-components=1
1717

1818
FROM debian:bullseye-slim
1919

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ make -j $(nproc)
5050
DISABLE_IPV6_TESTS=1 DISABLE_TMPFILE_TESTS=1 make test ARGS="-j $(nproc) -E ^routertest -VV"
5151

5252
make -j $(nproc) package
53+
54+
distro="$(lsb_release -c -s)"
55+
source ../MYSQL_VERSION
56+
57+
mv "mysql-${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}-linux-$(uname -m).tar.gz" "mysql-${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}-${distro}-linux-$(uname -m).tar.gz"

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
build:
66
context: ./
77
dockerfile: Dockerfile.build
8+
args:
9+
- BASE_IMAGE=${DISTRO}
810
volumes:
911
- "./dist:/dist"
1012

0 commit comments

Comments
 (0)