diff --git a/Makefile b/Makefile index eb7aebadb2d..788a492942f 100644 --- a/Makefile +++ b/Makefile @@ -321,15 +321,9 @@ endef docker_lite: ${call build_docker_image,docker/lite/Dockerfile,vitess/lite} -DOCKER_LITE_SUFFIX = testing ubi7 ubi8 ubi8.arm64 -DOCKER_LITE_TARGETS = $(addprefix docker_lite_,$(DOCKER_LITE_SUFFIX)) -$(DOCKER_LITE_TARGETS): docker_lite_%: - ${call build_docker_image,docker/lite/Dockerfile.$*,vitess/lite:$*} - docker_lite_push: - for i in $(DOCKER_LITE_SUFFIX); do echo "pushing lite image: $$i"; docker push vitess/lite:$$i || exit 1; done - -docker_lite_all: docker_lite $(DOCKER_LITE_TARGETS) + echo "pushing lite image: latest" + docker push vitess/lite:latest docker_local: ${call build_docker_image,docker/local/Dockerfile,vitess/local} diff --git a/docker/lite/Dockerfile b/docker/lite/Dockerfile index f7e8aba1310..ccbff94f225 100644 --- a/docker/lite/Dockerfile +++ b/docker/lite/Dockerfile @@ -18,7 +18,7 @@ # Use a temporary layer for the build stage. ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-common" +ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" FROM "${image}" AS builder @@ -36,6 +36,16 @@ RUN make install PREFIX=/vt/install # Start over and build the final image. FROM debian:bullseye-slim +# Install mysqlbinglog +RUN apt-get update && apt-get -y install libssl1.1 gnupg +COPY --from=builder /usr/bin/mysqlbinlog /usr/bin/mysqlbinlog + +# Install xtrabackup +RUN apt-key adv --no-tty --keyserver keyserver.ubuntu.com --recv-keys 9334A25F8507EFA5 +RUN echo 'deb http://repo.percona.com/apt bullseye main' > /etc/apt/sources.list.d/percona.list +RUN apt-get update -y +RUN apt-get install -y percona-xtrabackup-80 + # Set up Vitess user and directory tree. RUN groupadd -r vitess && useradd -r -g vitess vitess RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt diff --git a/docker/lite/Dockerfile.testing b/docker/lite/Dockerfile.testing deleted file mode 100644 index 2faa5a5a1c8..00000000000 --- a/docker/lite/Dockerfile.testing +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2019 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-common" - -FROM "${image}" AS builder - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Re-copy sources from working tree. -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -# Build and install Vitess in a temporary output directory. -USER vitess - -RUN make install-testing PREFIX=/vt/install - -# Start over and build the final image. -FROM debian:bullseye-slim - -# Set up Vitess user and directory tree. -RUN groupadd -r vitess && useradd -r -g vitess vitess -RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt -ENV VTDATAROOT /vt/vtdataroot -ENV PATH $VTROOT/bin:$PATH - -# Copy artifacts from builder layer. -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder --chown=vitess:vitess /vt/install /vt -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql /vt/config/ -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/mycnf /vt/config/ - -# Create mount point for actual data (e.g. MySQL data dir) -VOLUME /vt/vtdataroot -USER vitess diff --git a/docker/lite/Dockerfile.ubi7 b/docker/lite/Dockerfile.ubi7 deleted file mode 100644 index 634242c475e..00000000000 --- a/docker/lite/Dockerfile.ubi7 +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2019 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-common" - -FROM "${image}" AS builder - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Re-copy sources from working tree. -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -# Build and install Vitess in a temporary output directory. -USER vitess - -RUN make install PREFIX=/vt/install - -# Start over and build the final image. -FROM registry.access.redhat.com/ubi7/ubi:latest - -# Set up Vitess user and directory tree. -RUN groupadd -g 1001 -r vitess && useradd -r -u 1001 -g vitess vitess -RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt/src/vitess.io/vitess -ENV VTDATAROOT /vt/vtdataroot -ENV PATH $VTROOT/bin:$PATH - -# Copy artifacts from builder layer. -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder --chown=vitess:vitess /vt/install /vt -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql /vt/config/ -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/mycnf /vt/config/ - -RUN mkdir -p /licenses -COPY LICENSE /licenses - -# Create mount point for actual data (e.g. MySQL data dir) -VOLUME /vt/vtdataroot -USER vitess diff --git a/docker/lite/Dockerfile.ubi8 b/docker/lite/Dockerfile.ubi8 deleted file mode 100644 index 4c60be11103..00000000000 --- a/docker/lite/Dockerfile.ubi8 +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2022 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-common" - -FROM "${image}" AS builder - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Re-copy sources from working tree. -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -# Build and install Vitess in a temporary output directory. -USER vitess - -RUN make install PREFIX=/vt/install - -# Start over and build the final image. -FROM registry.access.redhat.com/ubi8/ubi:latest - -# Set up Vitess user and directory tree. -RUN groupadd -g 1001 -r vitess && useradd -r -u 1001 -g vitess vitess -RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt/src/vitess.io/vitess -ENV VTDATAROOT /vt/vtdataroot -ENV PATH $VTROOT/bin:$PATH - -# Copy artifacts from builder layer. -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder --chown=vitess:vitess /vt/install /vt -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql /vt/config/ -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/mycnf /vt/config/ - -RUN mkdir -p /licenses -COPY LICENSE /licenses - -# Create mount point for actual data (e.g. MySQL data dir) -VOLUME /vt/vtdataroot -USER vitess - diff --git a/docker/lite/Dockerfile.ubi8.arm64 b/docker/lite/Dockerfile.ubi8.arm64 deleted file mode 100644 index 571bce40f32..00000000000 --- a/docker/lite/Dockerfile.ubi8.arm64 +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2022 The Vitess Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=31 -ARG image="vitess/bootstrap:${bootstrap_version}-common" - -FROM "${image}" AS builder - -# Allows docker builds to set the BUILD_NUMBER -ARG BUILD_NUMBER - -# Re-copy sources from working tree. -COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess - -# Build and install Vitess in a temporary output directory. -USER vitess - -RUN make cross-install PREFIX=/vt/install GOOS=linux GOARCH=arm64 - -# Start over and build the final image. -FROM registry.access.redhat.com/ubi8/ubi:latest - -# Set up Vitess user and directory tree. -RUN groupadd -g 1001 -r vitess && useradd -r -u 1001 -g vitess vitess -RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt - -# Set up Vitess environment (just enough to run pre-built Go binaries) -ENV VTROOT /vt/src/vitess.io/vitess -ENV VTDATAROOT /vt/vtdataroot -ENV PATH $VTROOT/bin:$PATH - -# Copy artifacts from builder layer. -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder --chown=vitess:vitess /vt/install /vt -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql /vt/config/ -COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/mycnf /vt/config/ - -RUN mkdir -p /licenses -COPY LICENSE /licenses - -# Create mount point for actual data (e.g. MySQL data dir) -VOLUME /vt/vtdataroot -USER vitess -