Skip to content

Add git to dind variants (and make git an alias of dind, for 24.x and 25.x) #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2024
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
18 changes: 6 additions & 12 deletions 24/dind/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions 24/git/Dockerfile

This file was deleted.

18 changes: 6 additions & 12 deletions 25/dind/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions 25/git/Dockerfile

This file was deleted.

18 changes: 6 additions & 12 deletions Dockerfile-dind.template
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
{{ include "shared" -}}
FROM docker:{{ env.version }}-cli

# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
# https://github.com/moby/moby/blob/0eecd59153c03ced5f5ddd79cc98f29e4d86daec/project/PACKAGERS.md#runtime-dependencies
# https://github.com/docker/docker-ce-packaging/blob/963aa02666035d4e268f33c63d7868d6cdd1d34c/deb/common/control#L28-L41
RUN set -eux; \
apk add --no-cache \
btrfs-progs \
e2fsprogs \
e2fsprogs-extra \
git \
ip6tables \
iptables \
openssl \
pigz \
shadow-uidmap \
xfsprogs \
xz \
# pigz: https://github.com/moby/moby/pull/35697 (faster gzip implementation)
pigz \
; \
# only install zfs if it's available for the current architecture
# https://git.alpinelinux.org/cgit/aports/tree/main/zfs/APKBUILD?h=3.6-stable#n9 ("all !armhf !ppc64le" as of 2017-11-01)
# "apk info XYZ" exits with a zero exit code but no output when the package exists but not for this arch
if zfs="$(apk info --no-cache --quiet zfs)" && [ -n "$zfs" ]; then \
apk add --no-cache zfs; \
fi

# TODO aufs-tools
zfs \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually never really realised we're including zfs and btrfs in these images. With our "best effort" move towards overlayfs on all underlying filesystems, I'm also wondering how common it is to run DIND with zfs or btrfs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I changed this I was thinking about how zfs is probably going away entirely. 😂

I think things break if we don't have these and users are using them though, so 🤷

Both of these together are still smaller than Git 😂

;

# dind might be used on systems where the nf_tables kernel module isn't available. In that case,
# we need to switch over to xtables-legacy. See https://github.com/docker-library/docker/issues/463
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile-git.template

This file was deleted.

10 changes: 8 additions & 2 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ versionArches() {

comm -12 \
<(
version="$version" jq -r '
version="$version" jq -r --arg selector "$selector" '
.[env.version].arches | to_entries[]
| select(.value.'"$selector"')
| select(.value[$selector])
| .key
' versions.json | sort
) \
Expand Down Expand Up @@ -175,6 +175,12 @@ for version; do
suiteAliases=( "${suiteAliases[@]//latest-/}" )
variantAliases+=( "${suiteAliases[@]}" )
if [ "$variant" = 'dind' ]; then
# add "git" aliases https://github.com/docker-library/docker/issues/482#issuecomment-1955609423
if [ "$version" = '24' ] || [ "$version" = '25' ]; then
gitAliases=( "${versionAliases[@]/%/-git}" )
gitAliases=( "${gitAliases[@]//latest-/}" )
variantAliases+=( "${gitAliases[@]}" )
fi
# add "latest" aliases
suiteAliases=( "${versionAliases[0]}" ) # only "X.Y.Z-foo"
suiteAliases=( "${suiteAliases[@]/%/-alpine$alpine}" )
Expand Down
2 changes: 0 additions & 2 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
"cli",
"dind",
"dind-rootless",
"git",
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809"
],
Expand Down Expand Up @@ -276,7 +275,6 @@
"cli",
"dind",
"dind-rootless",
"git",
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809"
],
Expand Down
1 change: 0 additions & 1 deletion versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ for version in "${versions[@]}"; do
cli \
dind \
dind-rootless \
git \
windows/windowsservercore-ltsc2022 \
windows/windowsservercore-1809 \
; do
Expand Down