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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ COPY dist/cli/containerbase-cli-${TARGETARCH} /usr/local/containerbase/bin/conta

RUN install-containerbase

# renovate: datasource=github-tags packageName=git/git
RUN install-tool git v2.56.0
# renovate: datasource=github-releases packageName=containerbase/git-prebuild
RUN install-tool git 2.56.0


LABEL org.opencontainers.image.version="${CONTAINERBASE_VERSION}"
23 changes: 17 additions & 6 deletions docs/custom-base-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/
RUN install-containerbase


# renovate: datasource=github-tags packageName=git/git
RUN install-tool git v2.30.0
# renovate: datasource=github-releases packageName=containerbase/git-prebuild
RUN install-tool git 2.56.0
# renovate: datasource=github-releases packageName=containerbase/node-prebuild versioning=node
RUN install-tool node 20.9.0
# renovate: datasource=npm versioning=npm
Expand Down Expand Up @@ -86,8 +86,8 @@ COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/
RUN install-containerbase


# renovate: datasource=github-tags packageName=git/git
RUN install-tool git v2.30.0
# renovate: datasource=github-releases packageName=containerbase/git-prebuild
RUN install-tool git 2.56.0
# renovate: datasource=github-releases packageName=containerbase/node-prebuild versioning=node
RUN install-tool node 20.9.0
# renovate: datasource=npm versioning=npm
Expand Down Expand Up @@ -130,8 +130,19 @@ COPY --from=containerbase /usr/local/containerbase/ /usr/local/containerbase/
RUN install-containerbase


# renovate: datasource=github-tags packageName=git/git
RUN install-tool git v2.30.0
# renovate: datasource=github-releases packageName=containerbase/git-prebuild
RUN install-tool git 2.56.0

USER $USER_NAME
```

## git

`install-tool git` installs git from the containerbase prebuild into `/usr/local/bin`, not from Ubuntu.
To stay compatible with images built on Ubuntu's git, it also:

- installs the apt packages Ubuntu's git pulled in: `git-man`, `perl`, `liberror-perl` and `libcurl3-gnutls` (`libcurl3t64-gnutls` on noble and newer)
- links `git`, `git-receive-pack`, `git-shell`, `git-upload-archive`, `git-upload-pack` and `scalar` into `/usr/bin`, where Ubuntu's git put them, unless a file already exists there

Both go away in the next major release, see [#7821](https://github.com/containerbase/base/issues/7821) and [#7822](https://github.com/containerbase/base/issues/7822).
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
If your image needs any of these packages, install them yourself, e.g. `install-apt perl git-man libcurl3-gnutls` on jammy or `install-apt perl git-man libcurl3t64-gnutls` on noble and newer.
22 changes: 19 additions & 3 deletions docs/custom-registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,27 @@ https://github.com/cli/cli/releases/download/v2.97.0/gh_2.97.0_checksums.txt

## `git`

Git is downloaded from:
Git releases are downloaded from:

- `http://ppa.launchpad.net/git-core/ppa/ubuntu`
- `https://github.com/containerbase/git-prebuild/releases`

Git is installed via `apt` package manager.
The last url is used to find the latest version, if no version or no exact `X.Y.Z` version was provided.

Samples:

```txt
https://github.com/containerbase/git-prebuild/releases/download/2.56.0/git-2.56.0-jammy-x86_64.tar.xz.sha512
https://github.com/containerbase/git-prebuild/releases/download/2.56.0/git-2.56.0-jammy-x86_64.tar.xz
https://github.com/containerbase/git-prebuild/releases/download/2.56.0/git-2.56.0-jammy-aarch64.tar.xz.sha512
https://github.com/containerbase/git-prebuild/releases/download/2.56.0/git-2.56.0-jammy-aarch64.tar.xz
https://github.com/containerbase/git-prebuild/releases/latest/download/version
```

The download is always verified against the `.sha512` checksum, so a mirror needs to provide both files.
An exact `X.Y.Z` version from `2.48.0` on is downloaded as is, a release without a prebuild fails the download.
Any other version, like a partial `2.50`, a version before `2.48.0` or a vendor version like `2.43.0-1ubuntu1`, falls back to the newest prebuild with a warning.
The runtime libraries git needs are installed via `apt` package manager, see [custom base image](./custom-base-image.md#git) for the compatibility packages.
Images prepared by an older containerbase keep the git-core PPA apt source it added, they get the runtime libraries on the next `install-tool git`.

### `git-lfs`

Expand Down
5 changes: 2 additions & 3 deletions src/cli/install-tool/base-install.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ export abstract class BaseInstallService {

/**
* Some tools can only be installed as root, so they are only available at
* image build time. Eg. git is installed via apt.
* image build time. Eg. git, which writes the system wide `/etc/gitconfig`.
*/
readonly needsRoot: boolean = false;

/**
* Tools which are not installed into a versioned tool path can't be
* uninstalled, eg. git is installed system wide via apt.
* Some tools can't be uninstalled, eg. git, which other tools depend on.
*/
readonly canUninstall: boolean = true;

Expand Down
2 changes: 2 additions & 0 deletions src/cli/install-tool/version-resolvers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NugetVersionResolver } from '../tools/dotnet/nuget.ts';
import { GitVersionResolver } from '../tools/git/index.ts';
import { ResolverMap } from '../tools/index.ts';
import { AndroidSdkCmdlineToolsVersionResolver } from '../tools/java/android.ts';
import { GradleVersionResolver } from '../tools/java/gradle.ts';
Expand Down Expand Up @@ -32,6 +33,7 @@ export const versionResolvers: readonly VersionResolverClass[] = [
CocoapodsVersionResolver,
ConanVersionResolver,
ComposerVersionResolver,
GitVersionResolver,
GradleVersionResolver,
JavaVersionResolver,
JavaJreVersionResolver,
Expand Down
Loading