This isn't so much about Swift as getting libraries installed in Docker. For a Debian based Linux OS, there's some environment variables you can set to "take the defaults", if possible. The common patterns there:
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
And then when invoking the apt install commands, use the options -q -y
.
You can see an example of this in the Swift Dockerfile:
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
apt-get -q install -y \
binutils \
...
That said, a Deb package can be made that doesn't easily install and requires interactive responses. There's a more awkward-to-use tooling setup there where you can provide "pre packaged answers" - sometimes called a "seed" file, or an "answers" file. That's far more involved, and you can find some information about how to wrangle that from https://askubuntu.com/questions/1269227/how-to-answer-to-all-interactive-dialogs-and-non-dialog-questions
Hopefully packages you're using don't require that, and can be easily installed using the environment variable hints and the -y
option instead. At least I find that path MUCH easier to wrangle and less brittle.