-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathDockerfile.mysql84
More file actions
91 lines (67 loc) · 3.18 KB
/
Dockerfile.mysql84
File metadata and controls
91 lines (67 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright 2025 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.
FROM golang:1.26.3-trixie@sha256:0f6b034c99663ea8957e7dae99124e37374cbe7fcb5b5646f19b185f8f976279 AS go-builder
# Allows docker builds to set the BUILD_NUMBER
ARG BUILD_NUMBER
# Allows docker builds to set the BUILD_GIT_BRANCH
ARG BUILD_GIT_BRANCH
# Allows docker builds to set the BUILD_GIT_REV
ARG BUILD_GIT_REV
# Allows docker builds to set the BUILD_TIME
ARG BUILD_TIME
WORKDIR /vt/src/vitess.io/vitess
# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess
RUN mkdir -p /vt/vtdataroot /home/vitess
RUN chown -R vitess:vitess /vt /home/vitess
USER vitess
# Re-copy sources from working tree.
COPY --chown=vitess:vitess go.mod go.sum /vt/src/vitess.io/vitess/
RUN go mod download
COPY --chown=vitess:vitess . /vt/src/vitess.io/vitess
RUN make install PREFIX=/vt/install NOVTADMINBUILD=1
FROM node:26-trixie-slim@sha256:1e738cb88890a15c71880323fbc35a739b7bbc703d72e8bfd1613128f8182f78 AS vtadmin-builder
WORKDIR /vt/web/vtadmin
COPY web/vtadmin/package.json web/vtadmin/package-lock.json /vt/web/vtadmin/
RUN npm ci
COPY web/vtadmin/ /vt/web/vtadmin/
RUN VITE_VTADMIN_API_ADDRESS="http://localhost:14200" \
VITE_ENABLE_EXPERIMENTAL_TABLET_DEBUG_VARS="true" \
npm run build
# Start over and build the final image.
FROM debian:trixie-slim@sha256:b6e2a152f22a40ff69d92cb397223c906017e1391a73c952b588e51af8883bf8
# Install locale required for mysqlsh
RUN apt-get update && apt-get install -y locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen en_US.UTF-8
# Install dependencies
COPY docker/utils/install_dependencies.sh /vt/dist/install_dependencies.sh
RUN /vt/dist/install_dependencies.sh mysql84
# Set up Vitess user and directory tree.
RUN groupadd -r vitess && useradd -r -g vitess vitess
RUN mkdir -p /vt/vtdataroot /home/vitess && chown -R vitess:vitess /vt /home/vitess
# 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=go-builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=go-builder --chown=vitess:vitess /vt/install /vt
COPY --from=go-builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/vtadmin /vt/web/vtadmin
COPY --from=vtadmin-builder --chown=vitess:vitess /vt/web/vtadmin/build /vt/web/vtadmin/build
COPY --from=go-builder --chown=vitess:vitess /vt/src/vitess.io/vitess/config/init_db.sql /vt/config/
COPY --from=go-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