Merge pull request 'cascading-pr from https://code.forgejo.org/forgejo/lxc-helpers/pulls/15' (#29) from cascading-pr/act:forgejo/lxc-helpers-15 into main

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/29
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
This commit is contained in:
earl-warren 2023-12-02 16:54:48 +00:00
commit d38e069064

View file

@ -8,6 +8,8 @@ LXC_BIN=/usr/local/bin
LXC_CONTAINER_CONFIG_ALL="unprivileged lxc libvirt docker k8s"
LXC_CONTAINER_CONFIG_DEFAULT="lxc libvirt docker"
LXC_IPV6_PREFIX_DEFAULT="fc15"
LXC_DOCKER_PREFIX_DEFAULT="172.17"
LXC_IPV6_DOCKER_PREFIX_DEFAULT="fd00:d0ca"
: ${LXC_SUDO:=}
: ${LXC_CONTAINER_RELEASE:=bookworm}
@ -417,5 +419,16 @@ function lxc_install_docker() {
}
function lxc_install_docker_inside() {
mkdir /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"ipv6": true,
"fixed-cidr-v6": "$LXC_IPV6_DOCKER_PREFIX_DEFAULT:1::/64",
"default-address-pools": [
{"base": "$LXC_DOCKER_PREFIX_DEFAULT.0.0/16", "size": 24},
{"base": "$LXC_IPV6_DOCKER_PREFIX_DEFAULT:2::/104", "size": 112}
]
}
EOF
lxc_apt_install_inside docker.io docker-compose
}