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
This commit is contained in:
Alex Pyrgiotis 2023-07-31 18:26:15 +03:00
parent 6c374d8a7e
commit 76a1a885f5
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA
2 changed files with 15 additions and 0 deletions

View file

@ -141,6 +141,11 @@ USER user
WORKDIR /home/user WORKDIR /home/user
VOLUME /home/user/dangerzone 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. # Install Poetry under ~/.local/bin.
# See https://github.com/freedomofpress/dangerzone/issues/351 # See https://github.com/freedomofpress/dangerzone/issues/351
# FIXME: pipx install poetry does not work for Ubuntu Focal. # FIXME: pipx install poetry does not work for Ubuntu Focal.
@ -188,6 +193,12 @@ RUN echo user:2000:2000 > /etc/subgid
USER user USER user
WORKDIR /home/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. # Populate the build context.
shutil.copy(git_root() / "pyproject.toml", build_dir) shutil.copy(git_root() / "pyproject.toml", build_dir)
shutil.copy(git_root() / "poetry.lock", 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: with open(build_dir / "Dockerfile", mode="w") as f:
f.write(dockerfile) f.write(dockerfile)
@ -492,6 +504,7 @@ class Env:
# Populate the build context. # Populate the build context.
shutil.copy(package_src, package_dst) 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: with open(build_dir / "Dockerfile", mode="w") as f:
f.write(dockerfile) f.write(dockerfile)

2
dev_scripts/storage.conf Normal file
View file

@ -0,0 +1,2 @@
[storage]
driver = "overlay"