docker: add less and tini to base image.
Add `less` to the Docker image to fix an issue with running `bin/rails console`. The console uses Pry[1], which has an issue where it pipes long output through `less`, but it tries to use the -X option, which is only supported by GNU less, not Busybox less. There's a open bug about this in the Pry repo dating back to 2014[2]. Add `tini` and use it as the Docker entrypoint to ensure we forward signals to child processes and reap zombie children properly. This fixes an issue where if you ran something like: docker run ghcr.io/danbooru/danbooru bash -c 'bin/rails db:test:prepare && bin/rails test' Then you couldn't use control-C to stop the container. This was because bash wasn't forwarding signals to its children, and because by default, programs running as PID 1 ignore SIGINT and SIGTERM. See [3][4] for details. 1: https://github.com/pry/pry 2: https://github.com/pry/pry/issues.1248 3: https://github.com/krallin/tini/issues.8 4: https://gist.github.com/StevenACoffman/41fee08e8782b411a4a26b9700ad7af5#dont-run-pid-1
This commit is contained in:
@@ -22,7 +22,9 @@ DANBOORU_RUNTIME_DEPS="
|
||||
ca-certificates mkvtoolnix postgresql-client-12 libpq5
|
||||
zlib1g libfftw3-3 libwebp6 libwebpmux3 libwebpdemux2 liborc-0.4.0 liblcms2-2
|
||||
libpng16-16 libjpeg-turbo8 libexpat1 libglib2.0 libgif7 libexif12 libvpx6
|
||||
busybox $EXIFTOOL_RUNTIME_DEPS
|
||||
"
|
||||
COMMON_RUNTIME_DEPS="
|
||||
$DANBOORU_RUNTIME_DEPS $EXIFTOOL_RUNTIME_DEPS tini busybox less ncdu
|
||||
"
|
||||
|
||||
apt_install() {
|
||||
@@ -130,7 +132,7 @@ cleanup() {
|
||||
}
|
||||
|
||||
apt-get update
|
||||
apt_install $COMMON_BUILD_DEPS $DANBOORU_RUNTIME_DEPS
|
||||
apt_install $COMMON_BUILD_DEPS $COMMON_RUNTIME_DEPS
|
||||
install_asdf
|
||||
install_exiftool
|
||||
install_ffmpeg
|
||||
|
||||
Reference in New Issue
Block a user