建立一個安裝了 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

我確實同意你的觀點,這是一種駭客行為,但這是我能想到的最好的方法。

相關內容