vitess.io/vitess@v0.16.2/docker/mini/Dockerfile (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 FROM vitess/base AS base 21 22 FROM vitess/lite 23 24 USER root 25 26 RUN apt-get update 27 RUN apt-get install -y sudo curl vim python3 jq sqlite3 28 RUN ln -s /usr/bin/python3 /usr/bin/python 29 30 # Install minivitess dependencies 31 COPY docker/mini/install_mini_dependencies.sh /vt/dist/install_mini_dependencies.sh 32 RUN /vt/dist/install_mini_dependencies.sh 33 34 COPY docker/mini/orchestrator-vitess-mini.conf.json /etc/orchestrator.conf.json 35 RUN chown vitess:vitess /etc/orchestrator.conf.json 36 37 COPY docker/mini/docker-entry /vt/dist/docker/mini/docker-entry 38 COPY examples/common/scripts /vt/dist/scripts 39 COPY examples/common/env.sh /vt/dist/scripts/env.sh 40 COPY examples/common/lib/utils.sh /vt/dist/scripts/lib/utils.sh 41 COPY docker/mini/vtctld-mini-up.sh /vt/dist/scripts/vtctld-mini-up.sh 42 COPY docker/mini/vttablet-mini-up.sh /vt/dist/scripts/vttablet-mini-up.sh 43 COPY docker/mini/orchestrator-up.sh /vt/dist/scripts/orchestrator-up.sh 44 RUN echo "hostname=127.0.0.1" >> /vt/dist/scripts/env.sh 45 RUN cat /vt/dist/scripts/env.sh | egrep "^alias" >> /etc/bash.bashrc 46 47 COPY --from=base /vt/bin/vtctl /vt/bin/ 48 COPY --from=base /vt/bin/mysqlctl /vt/bin/ 49 50 # Set up Vitess environment (just enough to run pre-built Go binaries) 51 ENV VTROOT /vt/src/vitess.io/vitess 52 ENV VTDATAROOT /vt/vtdataroot 53 ENV PATH $VTROOT/bin:$PATH 54 ENV PATH="/vt/bin:${PATH}" 55 ENV PATH="/var/opt/etcd:${PATH}" 56 ENV TOPO="etcd" 57 58 # Create mount point for actual data (e.g. MySQL data dir) 59 VOLUME /vt/vtdataroot 60 USER vitess 61 EXPOSE 15000-15200 16000-16200 62 CMD /vt/dist/docker/mini/docker-entry && /bin/bash