From 412d58da61b6f1ce1ae191227443a43eccf4b3ea Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 24 Feb 2021 10:43:14 +0100 Subject: [PATCH] setup stretch-slim base image to allow installing openjdk The stretch-slim base image removes the man pages, docs, locales, etc. Some package install processes will fail if the dirs are not present, like /usr/share/man/man1. This includes default-jdk-headless, which someone would install if they wanted to run a gradle build in the Docker image before starting the emulator. The mkdir hack comes from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 --- emu/docker_device.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emu/docker_device.py b/emu/docker_device.py index f3226006..40dd75ca 100644 --- a/emu/docker_device.py +++ b/emu/docker_device.py @@ -103,7 +103,12 @@ class DockerDevice(object): "FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu18.04 AS emulator\n" + "ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display" ) - DEFAULT_BASE_IMG = "FROM debian:stretch-slim AS emulator" + DEFAULT_BASE_IMG = ( + "FROM debian:stretch-slim AS emulator\n" + + "RUN " + + "printf 'path-exclude=/usr/share/locale/*\npath-exclude=/usr/share/man/*\npath-exclude=/usr/share/doc/*\npath-include=/usr/share/doc/*/copyright\n'" + + " > /etc/dpkg/dpkg.cfg.d/01_nodoc && mkdir -p /usr/share/man/man1" + ) def __init__(self, emulator, sysimg, dest_dir, gpu=False, repo="", tag="", name=""): @@ -126,7 +131,6 @@ def __init__(self, emulator, sysimg, dest_dir, gpu=False, repo="", tag="", name= if not self.TAG_REGEX.match(self.tag): raise Exception("The resulting tag: {} is not a valid docker tag.", self.tag) - # The following are only set after creating/launching. self.container = None self.identity = None