4.7. 이미지 태그 지정

podman tag 명령을 사용하여 로컬 이미지에 이름을 추가합니다. 이 추가 이름은 < registryhost>/<username>/<name>:<tag > 이라는 여러 부분으로 구성될 수 있습니다.

사전 요구 사항

  • container-tools meta-package가 설치되어 있습니다.
  • 가져온 이미지는 로컬 시스템에서 사용할 수 있습니다.

절차

  1. 모든 이미지를 나열합니다.

    $ podman images
    REPOSITORY                           TAG     IMAGE ID      CREATED      SIZE
    registry.redhat.io/ubi9/ubi          latest  3269c37eae33  7 weeks ago  208 MB
  2. 다음 옵션 중 하나를 사용하여 registry.redhat.io/ubi9/ubi 이미지에 myubi 이름을 할당합니다.

    • 이미지 이름:

      $ podman tag registry.redhat.io/ubi9/ubi myubi
    • 이미지 ID:

      $ podman tag 3269c37eae33 myubi

      두 명령 모두 동일한 결과를 제공합니다.

  3. 모든 이미지를 나열합니다.

    $ podman images
    REPOSITORY                           TAG     IMAGE ID      CREATED       SIZE
    registry.redhat.io/ubi9/ubi          latest  3269c37eae33  2 months ago  208 MB
    localhost/myubi                      latest  3269c37eae33  2 months ago  208 MB

    기본 태그는 두 이미지 모두에 대해 latest 입니다. 단일 이미지 ID 3269c37eae33에 모든 이미지 이름이 할당되었음을 확인할 수 있습니다.

  4. 다음 중 하나를 사용하여 registry.redhat.io/ubi 9 /ubi 이미지에 9 태그를 추가합니다.

    • 이미지 이름:

      $ podman tag registry.redhat.io/ubi9/ubi myubi:9
    • 이미지 ID:

      $ podman tag 3269c37eae33 myubi:9

      두 명령 모두 동일한 결과를 제공합니다.

  5. 모든 이미지를 나열합니다.

    $ podman images
    REPOSITORY                           TAG     IMAGE ID      CREATED       SIZE
    registry.redhat.io/ubi9/ubi          latest  3269c37eae33  2 months ago  208 MB
    localhost/myubi                      latest  3269c37eae33  2 months ago  208 MB
    localhost/myubi                      9     3269c37eae33  2 months ago  208 MB

    기본 태그는 두 이미지 모두에 대해 latest 입니다. 단일 이미지 ID 3269c37eae33에 모든 이미지 이름이 할당되었음을 확인할 수 있습니다.

registry.redhat.io/ubi9/ubi 이미지에 태그를 지정한 후 컨테이너를 실행하는 세 가지 옵션이 있습니다.

  • ID 별(3269c37eae33)
  • 이름 별 (localhost/myubi:latest)
  • 이름(localhost/myubi:9)

추가 리소스

  • podman-tag man 페이지