
Ich verwende Packer, um ein von mir verwaltetes RStudio-Image zu aktualisieren (https://marketplace.digitalocean.com/apps/rstudio), das ist etwas, was ich für die Community mache. Das erste Skript in der Pipeline beginnt mit diesem Code:
#!/bin/bash
# non-interactive install
DEBIAN_FRONTEND=noninteractive
# Add a swap file to prevent build time OOM errors
fallocate -l 8G /swapfile
mkswap /swapfile
swapon /swapfile
# add CRAN to apt sources
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
printf '\n#CRAN mirror\ndeb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/\n' | tee -a /etc/apt/sources.list
# update apt
apt-get -qqy -o Dpkg::Options::=--force-confdef update
apt-get -qqy -o Dpkg::Options::=--force-confdef upgrade
Wenn ich den Prozess jedoch ausführe packer build conf.json
, schlägt er fehl, weil der OpenSSH-Server die nicht interaktive Konfiguration ignoriert und das Skript hier anhält:
digitalocean: A new version (/tmp/fileVGUVsU) of configuration file /etc/ssh/sshd_config is
digitalocean: available, but the version installed currently has been locally modified.
digitalocean:
digitalocean: 1. install the package maintainer's version
digitalocean: 2. keep the local version currently installed
digitalocean: 3. show the differences between the versions
digitalocean: 4. show a side-by-side difference between the versions
digitalocean: 5. show a 3-way difference between available versions
digitalocean: 6. do a 3-way merge between available versions
digitalocean: 7. start a new shell to examine the situation
Wie kann ich immer die 1. Option auswählen? Ich habe alle entsprechenden Beiträge gelesen, die ich finden konnte.