Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docker/k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificat

# Copy binaries
COPY --from=base /vt/bin/mysqlctld /vt/bin/
COPY --from=base /vt/bin/mysqlctl /vt/bin/
COPY --from=base /vt/bin/vtctld /vt/bin/
COPY --from=base /vt/bin/vtctl /vt/bin/
COPY --from=base /vt/bin/vtctlclient /vt/bin/
Expand Down
42 changes: 42 additions & 0 deletions docker/k8s/mysqlctl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2019 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.

ARG VT_BASE_VER=latest

FROM vitess/k8s:${VT_BASE_VER} AS k8s

FROM debian:buster-slim

# Set up Vitess environment (just enough to run pre-built Go binaries)
ENV VTROOT /vt
ENV VTDATAROOT /vtdataroot

# Prepare directory structure.
RUN mkdir -p /vt/bin && \
mkdir -p /vt/config && mkdir -p /vtdataroot

# Copy binaries
COPY --from=k8s /vt/bin/mysqlctl /vt/bin/

# Copy certs to allow https calls
COPY --from=k8s /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

# copy vitess config
COPY --from=k8s /vt/config /vt/config
Copy link
Copy Markdown
Contributor Author

@keweishang keweishang Feb 26, 2021

Choose a reason for hiding this comment

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

I'm not sure if the directory /vt/config is needed here? I'm copying it here because the mysqlctld docker image has it too.

Ideally, it'd be great if this docker image is more useful than just serving my purpose, which is to copy the /vt/bin/mysqlctl binary from this image (e.g. see example here).

Copy link
Copy Markdown
Collaborator

@deepthi deepthi Feb 26, 2021

Choose a reason for hiding this comment

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

/vt/config contains mysql .cnf files so it is probably required.


# add vitess user/group and add permissions
RUN groupadd -r --gid 2000 vitess && \
useradd -r -g vitess --uid 1000 vitess && \
chown -R vitess:vitess /vt && \
chown -R vitess:vitess /vtdataroot
5 changes: 5 additions & 0 deletions helm/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ docker tag vitess/mysqlctld:$vt_base_version-buster vitess/mysqlctld:$vt_base_ve
docker push vitess/mysqlctld:$vt_base_version-buster
docker push vitess/mysqlctld:$vt_base_version

docker build --build-arg VT_BASE_VER=$vt_base_version -t vitess/mysqlctl:$vt_base_version-buster mysqlctl
docker tag vitess/mysqlctl:$vt_base_version-buster vitess/mysqlctl:$vt_base_version
docker push vitess/mysqlctl:$vt_base_version-buster
docker push vitess/mysqlctl:$vt_base_version

docker build --build-arg VT_BASE_VER=$vt_base_version -t vitess/vtctl:$vt_base_version-buster vtctl
docker tag vitess/vtctl:$vt_base_version-buster vitess/vtctl:$vt_base_version
docker push vitess/vtctl:$vt_base_version-buster
Expand Down