containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.28k stars 2.37k forks source link

podman container clone does not copy healthcheck settings #21630

Open 1player opened 7 months ago

1player commented 7 months ago

Issue Description

A cloned container does not inherit the healthcheck settings of its parent

Steps to reproduce the issue

~ % podman run -d --rm --health-cmd "true" --name parent alpine sleep infinity
599c63a81b02bea5df00f16657628261d8ef595efa0a8faf0aa3f2e9c9ca925d
~ % podman healthcheck run parent
~ % podman container clone --run parent clone alpine
1254e8786fca42cadda713f6542b267b9b8ec2500e678635976a8dfa3b3758f8
~ % podman healthcheck run clone                    
Error: container 1254e8786fca42cadda713f6542b267b9b8ec2500e678635976a8dfa3b3758f8 has no defined healthcheck

Describe the results you received

The cloned container has not inherited the healthcheck settings of the parent

Describe the results you expected

The cloned container to inherit the healthcheck settings of the parent

podman info output

host:
  arch: amd64
  buildahVersion: 1.33.3
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.8-2.fc39.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.8, commit: '
  cpuUtilization:
    idlePercent: 97.63
    systemPercent: 0.54
    userPercent: 1.83
  cpus: 20
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: silverblue
    version: "39"
  eventLogger: journald
  freeLocks: 2006
  hostname: tranquility
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.7.4-200.fc39.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 7010418688
  memTotal: 67127726080
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc39.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.1-5.fc39.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.1
  ociRuntime:
    name: crun
    package: crun-1.14-1.fc39.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.14
      commit: 667e6ebd4e2442d39512e63215e79d693d0780aa
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20231230.gf091893-1.fc39.x86_64
    version: |
      pasta 0^20231230.gf091893-1.fc39.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: false
    path: /run/user/1000/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: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 71h 53m 45.00s (Approximately 2.96 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/sph/.config/containers/storage.conf
  containerStore:
    number: 22
    paused: 0
    running: 5
    stopped: 17
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/sph/.local/share/containers/storage
  graphRootAllocated: 1998678130688
  graphRootUsed: 335618269184
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 171
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /var/home/sph/.local/share/containers/storage/volumes
version:
  APIVersion: 4.9.0
  Built: 1706090847
  BuiltTime: Wed Jan 24 10:07:27 2024
  GitCommit: ""
  GoVersion: go1.21.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.9.0

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

No response

Additional information

No response

github-actions[bot] commented 6 months ago

A friendly reminder that this issue had no activity for 30 days.

Buzu commented 2 months ago

The same thing happens with working directory. If you set -w /some-directory in "parent", the "clone" will run in the default image directory.