Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install linux generic libc2.12 mysqlbinlog binary and libraries #15854

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions docker/lite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@

# Use a temporary layer for the build stage.
ARG bootstrap_version=31
ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"
ARG image="vitess/bootstrap:${bootstrap_version}-common"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was reverted back to common as we no longer need to copy mysqlbinlog from the bootstrap image.


FROM "${image}" AS builder

# Allows docker builds to set the BUILD_NUMBER
ARG BUILD_NUMBER

# Download linux generic mysql
USER root
RUN apt-get update && apt-get install -y xz-utils
RUN wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.37-linux-glibc2.12-x86_64.tar.xz
RUN tar -xf mysql-8.0.37-linux-glibc2.12-x86_64.tar.xz
RUN mv mysql-8.0.37-linux-glibc2.12-x86_64 mysql-generic-binaries

# Re-copy sources from working tree.
COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess

Expand All @@ -34,13 +41,10 @@ USER vitess
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
FROM --platform=linux/amd64 debian:bullseye-slim

# Install xtrabackup
RUN apt-get update && apt-get -y install gnupg
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
Expand All @@ -51,16 +55,19 @@ 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/src/vitess.io/vitess
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only use was for the vtdataroot directory, but we might as well put everything under /vt instead of having two different directories.

ENV VTDATAROOT /vt/vtdataroot
ENV VTROOT /vt
ENV VTDATAROOT $VTROOT/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/
COPY --from=builder --chown=vitess:vitess /vt/install $VTROOT
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin $VTROOT/web/vtadmin
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql $VTROOT/config/
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/mycnf $VTROOT/config/
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/mysql-generic-binaries/bin/mysqlbinlog $VTROOT/bin/mysqlbinlog
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/mysql-generic-binaries/lib/private/libcrypto.so.3 $VTROOT/lib/private/libcrypto.so.3
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/mysql-generic-binaries/lib/private/libssl.so.3 $VTROOT/lib/private/libssl.so.3
Comment on lines +69 to +70
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying the two libraries needed by mysqlbinlog into /vt/lib/private, the mysqlbinlog expects the libraires to be found there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frouioui This assumes we use always OpenSSL 3, which is not something we could assume yet I think? I don't think we can copy it like this tbh, those libraries themselves also then have dependencies and we suddenly would be responsible here for security issues in those versions and have to manage that? Which is a big pain since they are not versioned with apt-get at all.


# Create mount point for actual data (e.g. MySQL data dir)
VOLUME /vt/vtdataroot
Expand Down