Skip to content

podman build: rootless build takes up a lot of disk space #1570

@eero-t

Description

@eero-t

Issue Description

With default options, rootless podman build takes all disk space, using about 100x compared to docker.

Upstream release notes for newer Podman versions did not have any mention of fixing such issue, so I'm assuming that this bug is still valid.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Restore default state: sudo rm -rf ~/.config/containers/ ~/.local/share/containers/
  2. Build large container: podman build --format=docker --rm -t <tag> -f Dockerfile .

Describe the results you received

Podman uses hundreds of GBs to build few GB container, even after the container build has finished, due to defaulting to "vfs" driver, although "fuse-overlayfs" (1.7.1) is installed.

Describe the results you expected

Podman has sane disk usage, by defaulting to "overlay" storage driver when "fuse-overlayfs" is present: containers/podman#1726

podman info output

$ podman info
host:
  arch: amd64
  buildahVersion: 1.28.2
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.0.25+ds1-1.1_amd64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.25, commit: unknown'
  cpuUtilization:
    idlePercent: 99.59
    systemPercent: 0.06
    userPercent: 0.34
  cpus: 64
  distribution:
    codename: jammy
    distribution: ubuntu
    version: "22.04"
  eventLogger: journald
  hostname: texel
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1001
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 5.15.0-60-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 36563644416
  memTotal: 134931664896
  networkBackend: netavark
  ociRuntime:
    name: runc
    package: runc_1.1.4-0ubuntu1~22.04.1_amd64
    path: /usr/sbin/runc
    version: |-
      runc version 1.1.4-0ubuntu1~22.04.1
      spec: 1.0.2-dev
      go: go1.18.1
      libseccomp: 2.5.3
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1001/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.0.1-2_amd64
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.6.1
  swapFree: 0
  swapTotal: 0
  uptime: 1240h 19m 46.00s (Approximately 51.67 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/user/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/user/.local/share/containers/storage
  graphRootAllocated: 786455846912
  graphRootUsed: 315135950848
  graphStatus: {}
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 48
  runRoot: /run/user/1001/containers
  volumePath: /home/user/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 0
  BuiltTime: Thu Jan  1 02:00:00 1970
  GitCommit: ""
  GoVersion: go1.20.2
  Os: linux
  OsArch: linux/amd64
  Version: 4.3.1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

This is Ubuntu 23.04 "podman" package installed to Ubuntu 22.04 installation.

Additional information

This should have been fixed already before Podman v1.0 release: containers/podman#1726, so I guess it's a regression?

WA for the issue was found from here: containers/buildah#1040

$ sudo rm -r ~user/.local/share/containers/

$ mkdir -p ~user/.config/containers

$ cat > ~user/.config/containers/storage.conf
[storage]
driver = "overlay"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions