Red Hat Training

A Red Hat training course is available for RHEL 8

20.5. プライベートレジストリーへのコンテナーのプッシュ

buildah push コマンドを使用して、イメージをローカルストレージからパブリックリポジトリーまたはプライベートリポジトリーにプッシュします。

前提条件

手順

  1. マシンにローカルレジストリーを作成します。

    # podman run -d -p 5000:5000 registry:2
  2. myecho:latest イメージを localhost レジストリーにプッシュします。

    #  buildah push --tls-verify=false myecho:latest localhost:5000/myecho:latest
    Getting image source signatures
    Copying blob sha256:e4efd0...
    ...
    Writing manifest to image destination
    Storing signatures

検証

  1. localhost リポジトリー内のイメージをリスト表示します。

    # curl http://localhost:5000/v2/_catalog
    {"repositories":["myecho2]}
    
    
    # curl http://localhost:5000/v2/myecho2/tags/list
    {"name":"myecho","tags":["latest"]}
  2. docker://localhost:5000/myecho:latest イメージを調査します。

    # skopeo inspect --tls-verify=false docker://localhost:5000/myecho:latest | less
    {
        "Name": "localhost:5000/myecho",
        "Digest": "sha256:8999ff6050...",
        "RepoTags": [
            "latest"
        ],
        "Created": "2021-06-28T14:44:05.919583964Z",
        "DockerVersion": "",
        "Labels": {
            "architecture": "x86_64",
            "authoritative-source-url": "registry.redhat.io",
        ...
    }
  3. localhost:5000/myecho イメージをプルします。

    # podman pull --tls-verify=false localhost:5000/myecho2
    # podman run localhost:5000/myecho2
    This container works!

関連情報

  • buildah-push の man ページ