diff --git a/.gitattributes b/.gitattributes index 4f1544141a..9dd7ef0727 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1 @@ Dockerfile* linguist-language=Dockerfile -vendor.mod linguist-language=Go-Module -vendor.sum linguist-language=Go-Checksums diff --git a/Dockerfile b/Dockerfile index b36e807e67..f7c11f5496 100644 --- a/Dockerfile +++ b/Dockerfile @@ -159,10 +159,7 @@ RUN git init . && git remote add origin "https://github.com/containerd/container # CONTAINERD_VERSION is used to build containerd binaries, and used for the # integration tests. The distributed docker .deb and .rpm packages depend on a # separate (containerd.io) package, which may be a different version as is -# specified here. The containerd golang package is also pinned in vendor.mod. -# When updating the binary version you may also need to update the vendor -# version to pick up bug fixes or new APIs, however, usually the Go packages -# are built from a commit from the master branch. +# specified here. ARG CONTAINERD_VERSION=v1.7.28 RUN git fetch -q --depth 1 origin "${CONTAINERD_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD @@ -252,8 +249,7 @@ WORKDIR /usr/src/runc RUN git init . && git remote add origin "https://github.com/opencontainers/runc.git" # RUNC_VERSION should match the version that is used by the containerd version # that is used. If you need to update runc, open a pull request in the containerd -# project first, and update both after that is merged. When updating RUNC_VERSION, -# consider updating runc in vendor.mod accordingly. +# project first, and update both after that is merged. ARG RUNC_VERSION=v1.3.0 RUN git fetch -q --depth 1 origin "${RUNC_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD @@ -321,7 +317,7 @@ FROM tini-${TARGETOS} AS tini FROM base AS rootlesskit-src WORKDIR /usr/src/rootlesskit RUN git init . && git remote add origin "https://github.com/rootless-containers/rootlesskit.git" -# When updating, also update vendor.mod and hack/dockerfile/install/rootlesskit.installer accordingly. +# When updating, also update go.mod and hack/dockerfile/install/rootlesskit.installer accordingly. ARG ROOTLESSKIT_VERSION=v2.3.4 RUN git fetch -q --depth 1 origin "${ROOTLESSKIT_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD diff --git a/go.mod b/go.mod index 6a03fc4336..b943d1eb63 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,3 @@ -// 'vendor.mod' enables use of 'go mod vendor' to managed 'vendor/' directory. -// There is no 'go.mod' file, as the project has not yet completed the migration -// to a Go module. This project should be built in GOPATH mode, and not module mode, -// until the migration is complete and this file becomes 'go.mod.' - module github.com/moby/moby/v2 go 1.23.0 diff --git a/hack/buildkit-ref b/hack/buildkit-ref index d889f753ea..7b57457107 100755 --- a/hack/buildkit-ref +++ b/hack/buildkit-ref @@ -7,7 +7,7 @@ buildkit_pkg=github.com/moby/buildkit -# get buildkit version from vendor.mod +# get buildkit version from go.mod buildkit_ref=$(go list -mod=mod -u -m -f '{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}' "$buildkit_pkg") buildkit_repo=$(go list -mod=mod -u -m -f '{{if .Replace}}{{.Replace.Path}}{{else}}{{.Path}}{{end}}' "$buildkit_pkg") buildkit_repo=${buildkit_repo#github.com/} diff --git a/hack/dockerfile/install/containerd.installer b/hack/dockerfile/install/containerd.installer index 27b6f73c37..2c00c90d8c 100755 --- a/hack/dockerfile/install/containerd.installer +++ b/hack/dockerfile/install/containerd.installer @@ -10,11 +10,6 @@ set -e # as is specified here. # # Generally, the commit specified here should match a tagged release. -# -# The containerd golang package is also pinned in vendor.mod. When updating -# the binary version you may also need to update the vendor version to pick up -# bug fixes or new APIs, however, usually the Go packages are built from a -# commit from the master branch. : "${CONTAINERD_VERSION:=v1.7.28}" install_containerd() ( diff --git a/hack/dockerfile/install/rootlesskit.installer b/hack/dockerfile/install/rootlesskit.installer index ad1269de6b..29fe00af5e 100755 --- a/hack/dockerfile/install/rootlesskit.installer +++ b/hack/dockerfile/install/rootlesskit.installer @@ -1,6 +1,6 @@ #!/bin/sh -# When updating, also update vendor.mod and Dockerfile accordingly. +# When updating, also update go.mod and Dockerfile accordingly. : "${ROOTLESSKIT_VERSION:=v2.3.4}" install_rootlesskit() { diff --git a/hack/dockerfile/install/runc.installer b/hack/dockerfile/install/runc.installer index 44eea006ea..155637fd78 100755 --- a/hack/dockerfile/install/runc.installer +++ b/hack/dockerfile/install/runc.installer @@ -7,8 +7,6 @@ set -e # The version of runc should match the version that is used by the containerd # version that is used. If you need to update runc, open a pull request in # the containerd project first, and update both after that is merged. -# -# When updating RUNC_VERSION, consider updating runc in vendor.mod accordingly : "${RUNC_VERSION:=v1.3.0}" install_runc() { diff --git a/hack/validate/vendor b/hack/validate/vendor index a0b35d3f25..a7a3abf12c 100755 --- a/hack/validate/vendor +++ b/hack/validate/vendor @@ -5,7 +5,7 @@ set -e SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPTDIR}/.validate" -tidy_files=('vendor.mod' 'vendor.sum') +tidy_files=('go.mod' 'go.sum') vendor_files=("${tidy_files[@]}" 'vendor/') validate_vendor_tidy() { diff --git a/hack/vendor.sh b/hack/vendor.sh index c6123eab5f..ef54835676 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # This file is just a wrapper around the 'go mod vendor' tool. -# For updating dependencies you should change `vendor.mod` file in root of the +# For updating dependencies you should change `go.mod` file in root of the # project. set -e diff --git a/project/PACKAGERS.md b/project/PACKAGERS.md index 0f5df7081a..ecd04e68a9 100644 --- a/project/PACKAGERS.md +++ b/project/PACKAGERS.md @@ -39,18 +39,14 @@ The Dockerfile contains the most up-to-date list of build-time dependencies. ### Go Dependencies -All Go dependencies are vendored under "./vendor". They are used by the official -build, so the source of truth for the current version of each dependency is -whatever is in "./vendor". +All Go dependencies to build the daemon and related binaries are vendored +under "./vendor". They are used by the official build, so the source of +truth for the current version of each dependency is whatever is in "./vendor". If you would rather (or must, due to distro policy) package these dependencies -yourself, take a look at "vendor.mod" for an easy-to-parse list of the +yourself, take a look at "go.mod" for an easy-to-parse list of the exact version for each. -Note that this project is **not** a Go module. To properly build the project, -`GOPATH` mode must be used. The project is migrating to Go modules, but `vendor.mod` -should not be interchanged with `go.mod` until this transition is complete. - ## Stripping Binaries Please, please, please do not strip any compiled binaries. This is really