vitess.io/vitess@v0.16.2/docker/lite/Dockerfile.ubi8.arm64.mysql80 (about)

     1  # Copyright 2022 The Vitess Authors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  # NOTE: We have to build the Vitess binaries from scratch instead of sharing
    16  #       a base image because Docker Hub dropped the feature we relied upon to
    17  #       ensure images contain the right binaries.
    18  
    19  # Use a temporary layer for the build stage.
    20  ARG bootstrap_version=14.3
    21  ARG image="vitess/bootstrap:${bootstrap_version}-mysql80"
    22  
    23  FROM "${image}" AS builder
    24  
    25  # Allows docker builds to set the BUILD_NUMBER
    26  ARG BUILD_NUMBER
    27  
    28  # Re-copy sources from working tree.
    29  COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess
    30  
    31  # Build and install Vitess in a temporary output directory.
    32  USER vitess
    33  RUN make cross-install PREFIX=/vt/install GOOS=linux GOARCH=arm64
    34  
    35  # Start over and build the final image.
    36  FROM registry.access.redhat.com/ubi8/ubi:latest
    37  
    38  # Install keys and dependencies
    39  RUN mkdir /tmp/gpg && chmod 700 /tmp/gpg && export GNUPGHOME=/tmp/gpg \
    40   && yum install -y --setopt=alwaysprompt=no gnupg \
    41   && ( gpg --keyserver keyserver.ubuntu.com --recv-keys 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A 4D1BB29D63D98E422B2113B19334A25F8507EFA5 99DB70FAE1D7CE227FB6488205B555B38483C65D 3A79BD29 A4A9406876FCBD3C456770C88C718D3B5072E1F5 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1 ) \
    42   # No xtrabackup packages for aarch64 yet, but still keeping this here
    43   && gpg --export --armor 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A > ${GNUPGHOME}/RPM-GPG-KEY-Percona.1 \
    44   && gpg --export --armor 4D1BB29D63D98E422B2113B19334A25F8507EFA5 > ${GNUPGHOME}/RPM-GPG-KEY-Percona.2 \
    45   && gpg --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-CentOS-8 \
    46   && gpg --export --armor 94E279EB8D8F25B21810ADF121EA45AB2F86D6A1 > ${GNUPGHOME}/RPM-GPG-KEY-EPEL-8 \
    47   && gpg --export --armor 3A79BD29 > ${GNUPGHOME}/RPM-GPG-KEY-MySQL.1 \
    48   && gpg --export --armor A4A9406876FCBD3C456770C88C718D3B5072E1F5 > ${GNUPGHOME}/RPM-GPG-KEY-MySQL.2 \
    49   && rpmkeys --import ${GNUPGHOME}/RPM-GPG-KEY-Percona.1 ${GNUPGHOME}/RPM-GPG-KEY-Percona.2 ${GNUPGHOME}/RPM-GPG-KEY-CentOS-8 ${GNUPGHOME}/RPM-GPG-KEY-MySQL.1 ${GNUPGHOME}/RPM-GPG-KEY-MySQL.2 /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release \
    50   && curl -L --retry-delay 10 --retry 3 -o /tmp/mysqlrepo.rpm https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm \
    51   && curl -L --retry-delay 10 --retry 3 -o /tmp/perconarepo.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm \
    52   && rpmkeys --checksig /tmp/mysqlrepo.rpm /tmp/perconarepo.rpm \
    53   && rpm -Uvh /tmp/mysqlrepo.rpm /tmp/perconarepo.rpm \
    54   && rm -f /tmp/mysqlrepo.rpm /tmp/perconarepo.rpm
    55  RUN echo H4sICIDAHmICA2ZvbwDVkDFLxEAQhfv9FVfY7o4RhCBsoXJcIXKHwUIOi7m5MVk2yS6zG0//vYlRULTU4rrHvOHN+2ZL5Q4TP6oeO7bX3Od1pcuFXlyNUzVZg7S2yTmmCwDsgzjuDSUyB5SDI2+QzOChcyJBEnwkPOPQZijNuTkrigKmsHUFJ1MeCjUQEqg61tQweVtM0vOrfXItj1eAM0H0DiR2erTgbnOrV5uVvlk+6M+Kinvctby3p0ptqRziHjOnnxz3s/FnKJcxVlkYu/+k4Zcs+AvM8n3+jWW8MBc2NO6FZILUMEsoYQ76UvWI/vAGB/SOZZsCAAA= | base64 -d | gzip -dc > /etc/yum.repos.d/CentOS-Base.repo \
    56   && yum install -y --setopt=alwaysprompt=no --setopt=tsflags=nodocs --enablerepo c8base --enablerepo c8updates --enablerepo c8extras libev numactl-libs sysstat strace \
    57   && yum install -y --setopt=alwaysprompt=no --setopt=tsflags=nodocs https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/g/gperftools-libs-2.7-9.el8.aarch64.rpm https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/j/jemalloc-5.2.1-2.el8.aarch64.rpm https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/l/libunwind-1.3.1-3.el8.aarch64.rpm
    58  RUN yum update -y --setopt=alwaysprompt=no --setopt=tsflags=nodocs \
    59   && yum install -y --setopt=alwaysprompt=no --setopt=tsflags=nodocs bzip2 ca-certificates gnupg libaio libcurl \
    60      procps-ng rsync wget openssl hostname curl tzdata make \
    61  # Can't use alwaysprompt=no here, since we need to pick up deps
    62  #   No way to separate key imports and accept deps separately in yum/dnf
    63   && yum install -y --setopt=tsflags=nodocs --enablerepo mysql80-community \
    64      mysql-community-client mysql-community-server \
    65  # Have to use hacks to ignore conflicts on /etc/my.cnf install
    66   && mkdir -p /tmp/1 \
    67  # Enable xtrabackup and percona toolkit repo using the new percona-release tool, commented out for now (no aarch64 packages)
    68   #&& /usr/bin/percona-release enable-only pxb-80 \
    69   #&& /usr/bin/percona-release enable pt \
    70   #&& yum install -y --setopt=alwaysprompt=no --downloadonly --downloaddir=/tmp/1 --enablerepo mysql80-community percona-xtrabackup-80 percona-toolkit \
    71   #&& rpm -Uvh --replacefiles /tmp/1/*rpm \
    72   && rm -rf /tmp/1 \
    73   && yum clean all \
    74   && yum clean all --enablerepo mysql80-community \
    75   && rm -rf /etc/my.cnf /var/lib/mysql /tmp/gpg /sbin/mysqld-debug
    76  
    77  # Set up Vitess user and directory tree.
    78  RUN groupadd -g 1001 -r vitess && useradd -r -u 1001 -g vitess vitess
    79  RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt
    80  
    81  # Set up Vitess environment (just enough to run pre-built Go binaries)
    82  ENV VTROOT /vt/src/vitess.io/vitess
    83  ENV VTDATAROOT /vt/vtdataroot
    84  ENV PATH $VTROOT/bin:$PATH
    85  ENV MYSQL_FLAVOR MySQL80
    86  
    87  # Copy artifacts from builder layer.
    88  COPY --from=builder --chown=vitess:vitess /vt/install /vt
    89  COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin
    90  
    91  RUN mkdir -p /licenses
    92  COPY LICENSE /licenses
    93  
    94  # Create mount point for actual data (e.g. MySQL data dir)
    95  VOLUME /vt/vtdataroot
    96  USER vitess
    97  
    98  LABEL name="Vitess Lite image - MySQL Community Server 8.0" \
    99        io.k8s.display-name="Vitess Lite image - MySQL Community Server 8.0" \
   100        maintainer="cncf-vitess-maintainers@lists.cncf.io" \
   101        vendor="CNCF" \
   102        version="13.0.0" \
   103        release="1" \
   104        summary="Vitess base container image, containing Vitess components along with MySQL Community Server 8.0" \
   105        description="Vitess base container image, containing Vitess components along with MySQL Community Server 8.0" \
   106        io.k8s.description="Vitess base container image, containing Vitess components along with MySQL Community Server 8.0" \
   107        distribution-scope="public" \
   108        url="https://vitess.io"