@@ -116,6 +116,39 @@ COPY --from=build /workspace/app /usr/local/bin/
116116ENTRYPOINT [ "app" ]
117117```
118118
119+ ## Contributing
120+
121+ ### Updating the Go version
122+
123+ In the ` Dockerfile ` , update the default value of the ` GO_VERSION ` to the new target version.
124+
125+ ### Updating the base image variant
126+
127+ In the ` Dockerfile ` , update the ` BASE_VARIANT ` to the new target base variant. Then, ensure all build stages making use
128+ (or depend on) the base ` ${BASE_VARIANT} ` use it in their ` AS ` stage defined for the new variant. For example:
129+
130+ ``` Dockerfile
131+ ARG BASE_VARIANT=awesome-os
132+ ...
133+
134+ FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_VARIANT} as go-awesome-os
135+ ...
136+
137+ FROM go-${BASE_VARIANT} AS build-dependencies-awesome-os
138+ ```
139+
140+ ### Updating the ` libgit2 ` version
141+
142+ Change the default value of ` LIBGIT2_VERSION ` in ` hack/Makefile ` , if applicable, change the ` GIT2GO_TAG ` in the
143+ ` Makefile ` in the repository root as well to test against another version of [ git2go] [ ] .
144+
145+ ### Releasing a new image
146+
147+ For the ` main ` branch, images are pushed automatically to a tag matching the branch name, and a tag in the format of
148+ ` sha-<Git sha> ` . In addition, images are created for new tags, with as preferred format:
149+ ` <Go SemVer>-<image variant>-libgit2-<libgit2 SemVer> ` . For example, ` 1.16.8-bullseye-libgit2-1.1.1 ` for an image with
150+ ** Go 1.16.8** based on ** Debian bullseye** with ** libgit2 1.1.1** included.
151+
119152[ xx ] : https://github.com/tonistiigi/xx
120153[ Go container image ] : https://hub.docker.com/_/golang
121154[ libgit2 ] : https://github.com/libgit2/libgit2
0 commit comments