From 76a1a885f59cb8f48921c2aec53075f69dbc92bc Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Mon, 31 Jul 2023 18:26:15 +0300 Subject: [PATCH] Force Podman use the overlay storage driver Force Podman to use the overlay storage driver in our Dangerzone environments. We have seen that in certain cases, Podman may opt to use the vfs storage driver instead, which is more space-intensive. Closes #489 --- dev_scripts/env.py | 13 +++++++++++++ dev_scripts/storage.conf | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 dev_scripts/storage.conf diff --git a/dev_scripts/env.py b/dev_scripts/env.py index c82b7b6..56612f4 100755 --- a/dev_scripts/env.py +++ b/dev_scripts/env.py @@ -141,6 +141,11 @@ USER user WORKDIR /home/user VOLUME /home/user/dangerzone +# Force Podman to use a specific configuration. +# See https://github.com/freedomofpress/dangerzone/issues/489 +RUN mkdir -p /home/user/.config/containers +COPY storage.conf /home/user/.config/containers + # Install Poetry under ~/.local/bin. # See https://github.com/freedomofpress/dangerzone/issues/351 # FIXME: pipx install poetry does not work for Ubuntu Focal. @@ -188,6 +193,12 @@ RUN echo user:2000:2000 > /etc/subgid USER user WORKDIR /home/user + +######################################## +# Force Podman to use a specific configuration. +# See https://github.com/freedomofpress/dangerzone/issues/489 +RUN mkdir -p /home/user/.config/containers +COPY storage.conf /home/user/.config/containers """ @@ -446,6 +457,7 @@ class Env: # Populate the build context. shutil.copy(git_root() / "pyproject.toml", build_dir) shutil.copy(git_root() / "poetry.lock", build_dir) + shutil.copy(git_root() / "dev_scripts" / "storage.conf", build_dir) with open(build_dir / "Dockerfile", mode="w") as f: f.write(dockerfile) @@ -492,6 +504,7 @@ class Env: # Populate the build context. shutil.copy(package_src, package_dst) + shutil.copy(git_root() / "dev_scripts" / "storage.conf", build_dir) with open(build_dir / "Dockerfile", mode="w") as f: f.write(dockerfile) diff --git a/dev_scripts/storage.conf b/dev_scripts/storage.conf new file mode 100644 index 0000000..2f4bc14 --- /dev/null +++ b/dev_scripts/storage.conf @@ -0,0 +1,2 @@ +[storage] +driver = "overlay"