1

I'm using packer to update an RStudio image that I maintain (https://marketplace.digitalocean.com/apps/rstudio), this is something I do for the community. The 1st script in the pipeline starts with this 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

However, when I run packer build conf.json to run the process, it fails because openssh-server ignores the non-interactive configuration, and the script stops here:

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

How can I always select the 1st option? I've read all the related posts I could find.

pachadotdev
  • 111
  • 3

0 Answers0