创建一个安装了 docker 和 gitlab-ci-multi-runner 的 preseed.cfg ,为什么它总是被注释掉?

创建一个安装了 docker 和 gitlab-ci-multi-runner 的 preseed.cfg ,为什么它总是被注释掉?

我的预置几乎可以像我希望的那样工作,但由于某种原因,我无法将这两个存储库添加到 source.list 文件中。它总是被注释掉,无法验证它们。

我知道我可以将它们放入 Late_command 脚本中,但我真的希望将它们放入 cfg 文件中。

d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string http://xxx.xxx.xxx.xxx:xxxxx

## Setup GITLAB-MULTI-CI-RUNNER
d-i apt-setup/local0/repository string deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ stretch main
d-i apt-setup/local0/source boolean true
d-i apt-setup/local0/key string https://packages.gitlab.com/runner/gitlab-runner/gpgkey

## Setup DOCKER
d-i apt-setup/local1/repository string deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
d-i apt-setup/local1/source boolean false
d-i apt-setup/local1/key string https://download.docker.com/linux/debian/gpg

d-i debian-installer/allow_unauthenticated boolean true

我是否d-i遗漏了某些行,或者这样根本不可能?

答案1

我似乎遇到了完全相同的问题,至少在 docker 存储库中是这样。我认为这与它使用的事实有关https代替http作为运输。预置安装程序无法验证存储库,因为默认情况下未安装其中一个apt-transport-httpsca-certificates(或两个),因此它会注释掉/etc/apt/sources.list.

late_command就我而言,我设法通过安装必要的软件包,然后使用 a来启用安装后的存储库来解决该问题。

d-i pkgsel/include string ca-certificates apt-transport-https

d-i preseed/late_command string in-target sed -i 's/^#deb https:/deb https:/g' /etc/apt/sources.list

我确实同意你的观点,这是一种黑客行为,但这是我能想到的最好的办法。

相关内容