Skip to content

Commit 5fad71b

Browse files
committed
images/kubekins*: apply default Docker daemon.json
- Use the overlay2 storage driver - Disable the containerd snapshotter. Without this config we are hitting bugs when doing 'docker pull', 'docker save' from kubekins and then trying to 'ctr import' the resulted tar files.
1 parent 8589099 commit 5fad71b

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

images/bootstrap/runner.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,30 @@ if [[ "${DOCKER_IN_DOCKER_ENABLED}" == "true" ]]; then
4242
echo "Docker in Docker enabled, initializing..."
4343
printf '=%.0s' {1..80}; echo
4444

45-
# optionally enable CDI in Docker/containerd (see https://github.com/cncf-tags/container-device-interface?tab=readme-ov-file#docker-configuration)
46-
export CDI_IN_DOCKER_ENABLED=${CDI_IN_DOCKER_ENABLED:-false}
47-
if [[ "${CDI_IN_DOCKER_ENABLED}" == "true" ]]; then
48-
echo "Enabling CDI for Docker."
49-
mkdir -p /etc/docker/
50-
cat >/etc/docker/daemon.json <<EOF
45+
DAEMON_JSON=/etc/docker/daemon.json
46+
echo "Applying Docker config."
47+
48+
mkdir -p /etc/docker
49+
50+
# Use the overlay2 storage driver and disable the containerd snapshotter
51+
cat ${DAEMON_JSON} > /dev/null <<EOF
5152
{
52-
"features": {
53-
"cdi": true
54-
}
53+
"storage-driver": "overlay2",
54+
"features": {
55+
"containerd-snapshotter": false
56+
}
5557
}
5658
EOF
59+
60+
# Optionally enable CDI in Docker/containerd (see https://github.com/cncf-tags/container-device-interface?tab=readme-ov-file#docker-configuration)
61+
export CDI_IN_DOCKER_ENABLED=${CDI_IN_DOCKER_ENABLED:-false}
62+
if [[ "${CDI_IN_DOCKER_ENABLED}" == "true" ]]; then
63+
echo "Enabling CDI for Docker."
64+
jq '.features += {"cdi": true}' ${DAEMON_JSON} | tee ${DAEMON_JSON} > /dev/null
5765
fi
5866

67+
cat ${DAEMON_JSON}
68+
5969
# docker v27+ has ipv6 by default, but not all e2e hosts have everything
6070
# we need enabled by default
6171
# enable ipv6

images/kubekins-e2e-v2/runner.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ if [[ "${DOCKER_IN_DOCKER_ENABLED}" == "true" ]]; then
4848
# Fix ulimit issue
4949
sed -i 's|ulimit -Hn|ulimit -n|' /etc/init.d/docker || true
5050

51+
# Use the overlay2 storage driver and disable the containerd snapshotter
52+
DAEMON_JSON=/etc/docker/daemon.json
53+
echo "Applying Docker config."
54+
55+
mkdir -p /etc/docker
56+
cat ${DAEMON_JSON} > /dev/null <<EOF
57+
{
58+
"storage-driver": "overlay2",
59+
"features": {
60+
"containerd-snapshotter": false
61+
}
62+
}
63+
EOF
64+
65+
cat ${DAEMON_JSON}
66+
5167
# start the docker daemon
5268
service docker start
5369
# the service can be started but the docker socket not ready, wait for ready

0 commit comments

Comments
 (0)