Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about "command update" and "podman -p" bind more port question #7555

Closed
lilinxiong opened this issue Sep 8, 2020 · 8 comments
Closed

about "command update" and "podman -p" bind more port question #7555

lilinxiong opened this issue Sep 8, 2020 · 8 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@lilinxiong
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Output of podman version:

podman version 2.0.6

Output of podman --help:

Manage pods, containers and images

Usage:
  podman [flags]
  podman [command]

Available Commands:
  attach      Attach to a running container
  auto-update Auto update containers according to their auto-update policy
  build       Build an image using instructions from Containerfiles
  commit      Create new image based on the changed container
  container   Manage containers
  cp          Copy files/folders between a container and the local filesystem
  create      Create but do not start a container
  diff        Display the changes to the object's file system
  events      Show podman events
  exec        Run a process in a running container
  export      Export container's filesystem contents as a tar archive
  generate    Generate structured data based on containers and pods.
  healthcheck Manage health checks on containers
  help        Help about any command
  history     Show history of a specified image
  image       Manage images
  images      List images in local storage
  import      Import a tarball to create a filesystem image
  info        Display podman system information
  init        Initialize one or more containers
  inspect     Display the configuration of object denoted by ID
  kill        Kill one or more running containers with a specific signal
  load        Load an image from container archive
  login       Login to a container registry
  logout      Logout of a container registry
  logs        Fetch the logs of one or more containers
  manifest    Manipulate manifest lists and image indexes
  mount       Mount a working container's root filesystem
  network     Manage networks
  pause       Pause all the processes in one or more containers
  play        Play a pod and its containers from a structured file.
  pod         Manage pods
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image from a registry
  push        Push an image to a specified destination
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Removes one or more images from local storage
  run         Run a command in a new container
  save        Save image to an archive
  search      Search registry for image
  start       Start one or more containers
  stats       Display a live stream of container resource usage statistics
  stop        Stop one or more containers
  system      Manage podman
  tag         Add an additional name to a local image
  top         Display the running processes of a container
  unmount     Unmounts working container's root filesystem
  unpause     Unpause the processes in one or more containers
  unshare     Run a command in a modified user namespace
  untag       Remove a name from a local image
  version     Display the Podman Version Information
  volume      Manage volumes
  wait        Block on one or more containers

Flags:
      --cgroup-manager string     Cgroup manager to use ("cgroupfs"|"systemd") (default "cgroupfs")
      --cni-config-dir string     Path of the configuration directory for CNI networks
      --conmon string             Path of the conmon binary
  -c, --connection string         Connection to use for remote Podman service
      --events-backend string     Events backend to use ("file"|"journald"|"none") (default "file")
      --help                      Help for podman
      --hooks-dir strings         Set the OCI hooks directory path (may be set multiple times) (default [/usr/share/containers/oci/hooks.d])
      --identity string           path to SSH identity file, (CONTAINER_SSHKEY)
      --log-level string          Log messages above specified level (debug, info, warn, error, fatal, panic) (default "error")
      --namespace string          Set the libpod namespace, used to create separate views of the containers and pods on the system
      --network-cmd-path string   Path to the command for configuring the network
  -r, --remote                    Access remote Podman service (default false)
      --root string               Path to the root directory in which data, including images, is stored
      --runroot string            Path to the 'run directory' where all state information is stored
      --runtime string            Path to the OCI-compatible binary used to run containers, default is /usr/bin/runc
      --storage-driver string     Select which storage driver is used to manage storage of images and containers (default is overlay)
      --storage-opt stringArray   Used to pass an option to the storage driver
      --syslog                    Output logging information to syslog as well as the console (default false)
      --tmpdir string             Path to the tmp directory for libpod state content.

                                  Note: use the environment variable 'TMPDIR' to change the temporary storage location for container images, '/var/tmp'.

      --url string                URL to access Podman service (CONTAINER_HOST) (default "unix:/run/user/1000/podman/podman.sock")
  -v, --version                   Version of Podman

Use "podman [command] --help" for more information about a command.

In docker have "update". In latest podman I can't find "update".

If I want update container, What should I do?

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 8, 2020
@mheon
Copy link
Member

mheon commented Sep 8, 2020

Podman containers are, by design, immutable. As such, they cannot be updated or renamed once created. We have plans to implement a podman container clone command (tracked in #1925) that will allow for a copy of an existing container, with user-specified modifications, to be created, which we believe we accomplish much the same thing.

@mheon mheon closed this as completed Sep 8, 2020
@lilinxiong
Copy link
Author

@mheon Ok~ Thank you for your reply.
But I have a question. If containers immutable . why podman command has 'auto-update' ? in podman-auto-update - Man Page As if containers It's not immutable. Another podman container clone CPU Memory and Hard disk storage the cost is huge.
Please consider podman container update.
Thanks~

@mheon
Copy link
Member

mheon commented Sep 9, 2020

The podman auto-update command does not modify container - it re-creates them, using an identical command. Any changes to the container not contained in volumes are lost as part of this. Podman's architecture is not intended to support mutating containers once they have been created. The cost of creating a new container is not particularly large (the disk cost, in particular, is minimized by the use of image layering) so we don't view those as a serious obstacle to cloning containers.

@lilinxiong
Copy link
Author

My usage scenario is in containers use GPU, if through podman container clone my GPU will the double ?

@mheon
Copy link
Member

mheon commented Sep 9, 2020

Yes, that should work fine.

@lilinxiong
Copy link
Author

I mean if GPU memory 8G single container use 6G. if through podman container clone, my GPU memory insufficient…
If has podman update there won't be such a problem.
So please consider podman upadte It is very useful ~

@mheon
Copy link
Member

mheon commented Sep 10, 2020

The intention would be that the first container is stopped and (and potentially removed) after being cloned, so the two containers would not be active at the same time.

@lilinxiong
Copy link
Author

oh~ It's great ! Thank you for your explain.
I have another question. But, I'm not sure it is BUG or other…
about podman -p command
I run nginx container

podman run -d -v ~/data/nginx/:/etc/nginx/ -p 80:80 -p 443:443 --name nginx_ws nginx:1.19.2

Output of podman ps

CONTAINER ID  IMAGE                COMMAND               CREATED       STATUS                    PORTS           NAMES
279309746b6f  nginx:1.19.2    nginx -g daemon o...  43 hours ago  Up 42 hours ago     0.0.0.0:80->80/tcp        nginx_ws

I bind 80 and 443 port, But in podman ps show only 80 port.
But podman inspect nginx_ws output message(Only the HostConfig):

"HostConfig": {
            ...
            "CgroupMode": "host",
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "k8s-file",
                "Config": null
            },
            "NetworkMode": "bridge",
            "PortBindings": {
                "443/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "443"
                    }
                ],
                "80/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "80"
                    }
                ]
            },
          .....
        }

Is this normal ?

@lilinxiong lilinxiong changed the title about "Command update" about "command update" and "podman -p" bind more port question Sep 11, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

3 participants