From 1ab2da3aa170058121eaa5581b0c82e70494be5a Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 4 Jul 2024 12:46:20 -0400 Subject: [PATCH] Remove bootstrap dependency for the vttestserver image Signed-off-by: Florent Poinsard --- Makefile | 2 +- docker/vttestserver/Dockerfile.mysql80 | 22 ++++++++++------------ go/tools/go-upgrade/go-upgrade.go | 4 +++- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index f0b9038a769..e46f5d1ca5a 100644 --- a/Makefile +++ b/Makefile @@ -334,7 +334,7 @@ docker_lite: docker_mini: ${call build_docker_image,docker/mini/Dockerfile,vitess/mini} -DOCKER_VTTESTSERVER_SUFFIX = mysql57 mysql80 +DOCKER_VTTESTSERVER_SUFFIX = mysql80 DOCKER_VTTESTSERVER_TARGETS = $(addprefix docker_vttestserver_,$(DOCKER_VTTESTSERVER_SUFFIX)) $(DOCKER_VTTESTSERVER_TARGETS): docker_vttestserver_%: ${call build_docker_image,docker/vttestserver/Dockerfile.$*,vitess/vttestserver:$*} diff --git a/docker/vttestserver/Dockerfile.mysql80 b/docker/vttestserver/Dockerfile.mysql80 index d6b0a200fa7..2e79d389c7d 100644 --- a/docker/vttestserver/Dockerfile.mysql80 +++ b/docker/vttestserver/Dockerfile.mysql80 @@ -12,28 +12,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTE: We have to build the Vitess binaries from scratch instead of sharing -# a base image because Docker Hub dropped the feature we relied upon to -# ensure images contain the right binaries. - -# Use a temporary layer for the build stage. -ARG bootstrap_version=34 -ARG image="vitess/bootstrap:${bootstrap_version}-mysql80" - -FROM "${image}" AS builder +FROM --platform=linux/amd64 golang:1.22.5-bullseye AS builder # Allows docker builds to set the BUILD_NUMBER ARG BUILD_NUMBER +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 . /vt/src/vitess.io/vitess -# Build and install Vitess in a temporary output directory. -USER vitess RUN make install-testing PREFIX=/vt/install # Start over and build the final image. -FROM debian:bullseye-slim +FROM --platform=linux/amd64 debian:bullseye-slim # Install dependencies COPY docker/utils/install_dependencies.sh /vt/dist/install_dependencies.sh diff --git a/go/tools/go-upgrade/go-upgrade.go b/go/tools/go-upgrade/go-upgrade.go index dbec922d578..34543120202 100644 --- a/go/tools/go-upgrade/go-upgrade.go +++ b/go/tools/go-upgrade/go-upgrade.go @@ -393,6 +393,9 @@ func replaceGoVersionInCodebase(old, new *version.Version, workflowUpdate bool) "./test/templates", "./build.env", "./docker/bootstrap/Dockerfile.common", + "./docker/lite/Dockerfile", + "./docker/lite/Dockerfile.percona80", + "./docker/vttestserver/Dockerfile.mysql80", } if workflowUpdate { explore = append(explore, "./.github/workflows") @@ -435,7 +438,6 @@ func updateBootstrapVersionInCodebase(old, new string, newGoVersion *version.Ver return nil } files, err := getListOfFilesInPaths([]string{ - "./docker/vttestserver", "./Makefile", "./test/templates", })