Skip to content

Rootless podman: support passing arbitrary paths to configuration files #6053

@grahamc

Description

@grahamc

/kind feature

Description

I'd like to be able to specify all configuration files to podman (rootless or not) via configuration flags or podman-specific environment variables.

On Podman 1.9.1 and 1.8.2, when I run podman import result/tarball/nixos-system-x86_64-linux.tar.xz my-image, I get:

Error: open /etc/containers/policy.json: no such file or directory

I found #1336 (rootless: allow to override policy.json by the user) but creating a file at ~/.config/containers/policy.json doesn't seem to change the error. Additionally, since this is part of some automation, I do not want the runners to need to add configuration to their ~ either, and overriding HOME during the test phase is a bit ugly.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

both:

Version:            1.8.2
RemoteAPI Version:  1
Go Version:         go1.14.1
Built:              Wed Dec 31 19:00:01 1969
OS/Arch:            linux/amd64
debug:
  compiler: gc
  git commit: ""
  go version: go1.14.1
  podman version: 1.8.2
host:
  BuildahVersion: 1.14.3
  CgroupVersion: v1
  Conmon:
    package: Unknown
    path: /nix/store/3dndp024ipa71x2iq9nphq0r4xic7irk-conmon-2.0.15/bin/conmon
    version: 'conmon version 2.0.15, commit: unknown'
  Distribution:
    distribution: nixos
    version: 20.03.1422.1e90c46c2d9
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 100
      size: 1
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
  MemFree: 2304905216
  MemTotal: 16424857600
  OCIRuntime:
    name: runc
    package: Unknown
    path: /nix/store/a0ghvlp1416x90k3a65f9p78zbkqpc5x-runc-1.0.0-rc10-bin/bin/runc
    version: |-
      runc version 1.0.0-rc10
      spec: 1.0.1-dev
  SwapFree: 17149521920
  SwapTotal: 17177767936
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: Petunia
  kernel: 5.5.17
  os: linux
  rootless: true
  slirp4netns:
    Executable: /nix/store/qch3lh6r65qwd3jziczbkl2ma13673kh-slirp4netns-1.0.1/bin/slirp4netns
    Package: Unknown
    Version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.3.0
  uptime: 19h 52m 35.67s (Approximately 0.79 days)
registries: {}
store:
  ConfigFile: /home/grahamc/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: vfs
  GraphOptions: {}
  GraphRoot: /home/grahamc/.local/share/containers/storage
  GraphStatus: {}
  ImageStore:
    number: 0
  RunRoot: /run/user/1000/containers
  VolumePath: /home/grahamc/.local/share/containers/storage/volumes

and

Version:            1.9.1
RemoteAPI Version:  1
Go Version:         go1.14.1
Built:              Wed Dec 31 19:00:01 1969
OS/Arch:            linux/amd64
debug:
  compiler: gc
  gitCommit: ""
  goVersion: go1.14.1
  podmanVersion: 1.9.1
host:
  arch: amd64
  buildahVersion: 1.14.8
  cgroupVersion: v1
  conmon:
    package: Unknown
    path: /nix/store/3dndp024ipa71x2iq9nphq0r4xic7irk-conmon-2.0.15/bin/conmon
    version: 'conmon version 2.0.15, commit: unknown'
  cpus: 8
  distribution:
    distribution: nixos
    version: 20.03.1422.1e90c46c2d9
  eventLogger: file
  hostname: Petunia
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 100
      size: 1
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
  kernel: 5.5.17
  memFree: 2319196160
  memTotal: 16424857600
  ociRuntime:
    name: runc
    package: Unknown
    path: /nix/store/a0ghvlp1416x90k3a65f9p78zbkqpc5x-runc-1.0.0-rc10-bin/bin/runc
    version: |-
      runc version 1.0.0-rc10
      spec: 1.0.1-dev
  os: linux
  rootless: true
  slirp4netns:
    executable: /nix/store/qch3lh6r65qwd3jziczbkl2ma13673kh-slirp4netns-1.0.1/bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.0.1
      commit: 6a7b16babc95b6a3056b33fb45b74a6f62262dd4
      libslirp: 4.3.0
  swapFree: 17149521920
  swapTotal: 17177767936
  uptime: 19h 51m 42.91s (Approximately 0.79 days)
registries: {}
store:
  configFile: /home/grahamc/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/grahamc/.local/share/containers/storage
  graphStatus: {}
  imageStore:
    number: 0
  runRoot: /run/user/1000/containers
  volumePath: /home/grahamc/.local/share/containers/storage/volumes

Additional environment details (AWS, VirtualBox, physical, etc.):

I'd like to be able to do this universally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions