Skip to content

Commit

Permalink
Remove bootstrap dependency for the vttestserver image
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Jul 8, 2024
1 parent 7dcf64b commit 1ab2da3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:$*}
Expand Down
22 changes: 10 additions & 12 deletions docker/vttestserver/Dockerfile.mysql80
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion go/tools/go-upgrade/go-upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -435,7 +438,6 @@ func updateBootstrapVersionInCodebase(old, new string, newGoVersion *version.Ver
return nil
}
files, err := getListOfFilesInPaths([]string{
"./docker/vttestserver",
"./Makefile",
"./test/templates",
})
Expand Down

0 comments on commit 1ab2da3

Please sign in to comment.