vitess.io/vitess@v0.16.2/docker/lite/Dockerfile.mysql57 (about) 1 # Copyright 2019 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}-mysql57" 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 install PREFIX=/vt/install 34 35 # Start over and build the final image. 36 FROM debian:buster-slim 37 38 # Install dependencies 39 COPY docker/lite/install_dependencies.sh /vt/dist/install_dependencies.sh 40 RUN /vt/dist/install_dependencies.sh mysql57 41 42 # Set up Vitess user and directory tree. 43 RUN groupadd -r vitess && useradd -r -g vitess vitess 44 RUN mkdir -p /vt/vtdataroot && chown -R vitess:vitess /vt 45 46 # Set up Vitess environment (just enough to run pre-built Go binaries) 47 ENV VTROOT /vt/src/vitess.io/vitess 48 ENV VTDATAROOT /vt/vtdataroot 49 ENV PATH $VTROOT/bin:$PATH 50 51 # Copy artifacts from builder layer. 52 COPY --from=builder --chown=vitess:vitess /vt/install /vt 53 COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin 54 55 # Create mount point for actual data (e.g. MySQL data dir) 56 VOLUME /vt/vtdataroot 57 USER vitess