Skip to content
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

Housekeeping for docker #5178

Merged
merged 1 commit into from
Jun 6, 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
12 changes: 0 additions & 12 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -1897,18 +1897,6 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-tags",
"depNameTemplate": "moby/moby",
"extractVersionTemplate": "^v(?<version>24\\..+?)$",
"fileMatch": [
"^tools/docker-stable/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down
34 changes: 28 additions & 6 deletions tools/docker-preview/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,26 @@ function is_alpine() {
esac
}

if test "${name}" == "docker"; then
echo "Install systemd unit (@ ${SECONDS} seconds)"
cat "${target}/etc/systemd/system/docker.service" \
| sed -E "s|/usr/local/bin/dockerd|${target}/bin/dockerd|" \
>"/etc/systemd/system/docker.service"

echo "Patch paths in init scripts (@ ${SECONDS} seconds)"
sed -i -E "s|^DOCKERD=/usr/local/bin/dockerd|DOCKERD=${target}/bin/dockerd|" "${uniget_contrib}/${name}/sysvinit/debian/docker"
sed -i -E "s|/usr/local/bin/dockerd|${target}/bin/dockerd|" "${uniget_contrib}/${name}/sysvinit/redhat/docker"
sed -i "s|/usr/local/bin/dockerd|${target}/bin/dockerd|" "${uniget_contrib}/${name}/openrc/docker.initd"
sed -i "s|/usr/local/bin/dockerd|${target}/bin/dockerd|" "${uniget_contrib}/${name}/openrc/docker.confd"
fi

if test -f "/etc/group"; then
echo "Create group (@ ${SECONDS} seconds)"
groupadd --prefix "" --system --force docker
fi

echo "Configure daemon (@ ${SECONDS} seconds)"
mkdir -p "/etc/${name}"
mkdir -p "/etc/docker"
if ! test -f "/etc/${name}/daemon.json"; then
echo "Initialize dockerd configuration"
echo "{}" >"/etc/${name}/daemon.json"
Expand All @@ -89,17 +102,20 @@ if test -f "/etc/fstab"; then
echo "Configuring storage driver for DinD"
# shellcheck disable=SC2094
cat <<< "$(jq '. * {"storage-driver": "fuse-overlayfs"}' "/etc/${name}/daemon.json")" >"/etc/${name}/daemon.json"

else
echo "fuse-overlayfs should be planned for installation."
fi
fi
fi

if ! test "$(jq '."exec-opts" // [] | any(. | startswith("native.cgroupdriver="))' "/etc/${name}/daemon.json")" == "true"; then
echo "Configuring native cgroup driver"
# shellcheck disable=SC2094
cat <<< "$(jq '."exec-opts" += ["native.cgroupdriver=cgroupfs"]' "/etc/${name}/daemon.json")" >"/etc/${name}/daemon.json"

if systemctl >/dev/null 2>&1; then
# shellcheck disable=SC2094
cat <<< "$(jq '."exec-opts" += ["native.cgroupdriver=systemd"]' "/etc/${name}/daemon.json")" >"/etc/${name}/daemon.json"
else
# shellcheck disable=SC2094
cat <<< "$(jq '."exec-opts" += ["native.cgroupdriver=cgroupfs"]' "/etc/${name}/daemon.json")" >"/etc/${name}/daemon.json"
fi
fi
if ! test "$(jq '. | keys | any(. == "default-runtime")' "/etc/${name}/daemon.json")" == true; then
echo "Set default runtime"
Expand Down Expand Up @@ -160,6 +176,12 @@ fi
if systemctl >/dev/null 2>&1; then
echo "Reload systemd (@ ${SECONDS} seconds)"
systemctl daemon-reload

if test "${name}" == "docker" && ! systemctl is-active --quiet docker; then
echo "Start dockerd (@ ${SECONDS} seconds)"
systemctl enable docker
systemctl start docker
fi
fi

echo "Finished after ${SECONDS} seconds."
76 changes: 0 additions & 76 deletions tools/docker-stable/Dockerfile.template

This file was deleted.

29 changes: 0 additions & 29 deletions tools/docker-stable/manifest.yaml

This file was deleted.

182 changes: 0 additions & 182 deletions tools/docker-stable/post_install.sh

This file was deleted.

Loading
Loading