Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dockerから替わる?新しいコンテナ技術の紹介

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for YouYou YouYou
December 22, 2020

 Dockerから替わる?新しいコンテナ技術の紹介

Avatar for YouYou

YouYou

December 22, 2020
Tweet

More Decks by YouYou

Other Decks in Technology

Transcript

  1. Podmanとは Red Hat社が開発したコンテナ管理ツール → Podman.io • デーモンレス • 一般ユーザで起動可能 •

    dockerと互換性有り Dockerユーザーのための PodmanとBuildahの紹介 https://rheb.hatenablog.com/entry/2020/07/16/podman_buidah_for_docker_users
  2. Red Hatの積極的推進 • CentOS 8と RHEL 8からdockerコマンドを標準で削除 • サポートそのものも対象外 •

    Red Hat公式リファレンスでもPodmanでのコンテナ管理紹介 ◦ コンテナーの構築、実行、および管理 yum(dnf) module install -y container-tools RHEL(CentOS)ならインストールも簡単
  3. コンテナ起動 $ podman run --rm registry.access.redhat.com/rhel7.2 cat /etc/os-release NAME="Red Hat

    Enterprise Linux Server" VERSION="7.2 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.2" PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.2 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.2" コンテナを起動し、OS情報を参照している podan search でコンテナの検索も可能 ★dockerコンテナも起動できる Explore Certified Container Images ↑Red Hat社で管理しているコンテナイメージ群
  4. Podの作成 $ podman pod create --name testpod $ podman pod

    ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID d1d6f6c351f7 testpod Created 8 seconds ago 1 b037a9286dfa $ podman ps -a --pod CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES   POD ID PODNAME b037a9286dfa k8s.gcr.io/pause:3.2 38 seconds ago Created d1d6fc351f7-infra d1d6f6c351f7 testpod $ podman run -dt --name mycontainer --pod testpod registry.access.redhat.com/rhel7.5 /bin/bash $ podman pod ps POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID d1d6f6c351f7 testpod Running 7 minutes ago 2 b037a9286dfa podman ps -a --pod CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES POD ID PODNAME 22714a066cc0 registry.access.redhat.com/rhel7.5:latest /bin/bash 24 seconds ago Up 24 seconds ago mycontainer d1d6f6c351f7 testpod b037a9286dfa k8s.gcr.io/pause:3.2 8 minutes ago Up 24 seconds ago d1d6f6c351f7-infra d1d6f6c351f7 testpod
  5. Podの作成 Kubernetes YAML ファイルも生成可能 $ podman generate kube testpod >

    testpod.yml # Generation of Kubernetes YAML is still under development! # # Save the output of this file and use kubectl create -f to import # it into Kubernetes. # # Created with podman-2.0.5 apiVersion: v1 kind: Pod metadata: creationTimestamp: "2020-12-21T17:15:47Z" labels: app: testpod ~~~~ testpod.yml