- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- 日記/2020-05-12 へ行く。
- 1 (2020-05-13 (水) 09:50:08)
先日はmacOS上でpodman-machineからLinuxコンテナ環境を作成してpodmanでコンテナイメージを実行できることを確認した。
日記/2020-05-07
今回は、RHELのコンテナイメージ(UBI)を試しに実行してみる。
コンテナイメージの利用についてはページ末尾の参考リンクを参照のこと。
どのように利用できるか、については以下の資料が分かり易く説明されている。
参考 https://speakerdeck.com/moriwaka/ubi-faq
podman-machineを実行してLinuxコンテナ実行環境にsshでログインする。
$ podman-machine start podman-box Starting "podman-box"... (podman-box) Check network to re-create if needed... (podman-box) Waiting for an IP... Machine "podman-box" was started. Waiting for SSH to be available... Detecting the provisioner... Started machines may have new IP addresses. You may need to re-run the `podman-machine env` command. $ podman-machine ssh podman-box .---. b o o t 2 mm https://podman.io /o o\ ## __(= " =)__ ##m###m m####m m###m## ####m##m m#####m ##m####m //\'-=-'/\\ ##" "## ##" "## ##" "## ## ## ## " mmm## ##" ## ) ( ## ## ## ## ## ## ## ## ## m##"""## ## ## / \ ###mm##" "##mm##" "##mm### ## ## ## ##mmm### ## ## ____/ / \ \____ ## """ """" """ "" "" "" "" """" "" "" "" `------'`"`'------' ## art: jgs tc@podman-box:~$
続いてコンテナイメージを検索してみる。
tc@podman-box:~$ podman search registry.redhat.io/ubi8 INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED redhat.io registry.redhat.io/ubi8 The Universal Base Image is designed and eng... 0 redhat.io registry.redhat.io/ubi8/ubi Provides the latest release of the Red Hat U... 0 redhat.io registry.redhat.io/ubi8/ubi-minimal Provides the latest release of the Minimal R... 0 redhat.io registry.redhat.io/ubi8/ubi-init Provides the latest release of the Red Hat U... 0 redhat.io registry.redhat.io/ubi8-minimal The Universal Base Image Minimal is a stripp... 0 redhat.io registry.redhat.io/ubi8/nodejs-12 Platform for building and running Node.js 12... 0 redhat.io registry.redhat.io/ubi7/ubi The Universal Base Image is designed and eng... 0 redhat.io registry.redhat.io/ubi8-init The Universal Base Image Init is designed to... 0 redhat.io registry.redhat.io/ubi7-init The Universal Base Image Init is designed to... 0 redhat.io registry.redhat.io/ubi7/ubi-minimal The Universal Base Image Init is designed to... 0 redhat.io registry.redhat.io/ubi7/ubi-init The Universal Base Image Init is designed to... 0 redhat.io registry.redhat.io/ubi7 The Universal Base Image is designed and eng... 0 redhat.io registry.redhat.io/ubi7-minimal The Universal Base Image Minimal is a stripp... 0 redhat.io registry.redhat.io/ubi8/go-toolset Platform for building and running Go 1.11.5 ... 0 redhat.io registry.redhat.io/ubi8/s2i-core Base image which allows using of source-to-i... 0 redhat.io registry.redhat.io/ubi8/dotnet-21-runtime Provides the latest release of Red Hat Enter... 0 redhat.io registry.redhat.io/ubi8/openjdk-8 Source To Image (S2I) image for Red Hat Open... 0 redhat.io registry.redhat.io/ubi8/openjdk-11 Source To Image (S2I) image for Red Hat Open... 0 redhat.io registry.redhat.io/ubi8/dotnet-31-runtime .NET Core 3.1 runtime only on RHEL 8 0 redhat.io registry.redhat.io/ubi8/dotnet-31 .NET Core 3.1 SDK and Runtime on RHEL 8 0 redhat.io registry.redhat.io/ubi8/php-72 Platform for building and running PHP 7.2 ap... 0 redhat.io registry.redhat.io/ubi8/s2i-base Base image with essential libraries and tool... 0 redhat.io registry.redhat.io/ubi8/perl-526 Platform for building and running Perl 5.26 ... 0 redhat.io registry.redhat.io/ubi8/nodejs-10 Platform for building and running Node.js 10... 0 redhat.io registry.redhat.io/ubi8/ruby-25 Platform for building and running Ruby 2.5 a... 0
goやjdk、phpなどの実行環境がプリインストールされたイメージもあるようだ。
ubi-minimalというコンテナイメージをpullしてみる。
tc@podman-box:~$ podman pull registry.redhat.io/ubi8/ubi-minimal Trying to pull registry.redhat.io/ubi8/ubi-minimal... Getting image source signatures Copying blob 1b99828eddf5 done Copying blob e96e3a1df3b2 done Copying config 401e359e0f [======================================] 4.2KiB / 4.2KiB Writing manifest to image destination Storing signatures 401e359e0f45bfdcf004e258b72e253fd07fba8cc5c6f2ed4f4608fb119ecc2c
コンテナのサイズを見てみると、ubi8に比べて70Mほど小さいようだ。
tc@podman-box:~$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/nginx 1.18 1857c2b71337 2 weeks ago 136 MB registry.redhat.io/ubi8 latest 8e0b0194b7e1 2 weeks ago 211 MB registry.redhat.io/ubi8/ubi-minimal latest 401e359e0f45 2 weeks ago 146 MB
bashを実行してみる。
tc@podman-box:~$ podman run -it registry.redhat.io/ubi8/ubi-minimal /bin/bash [root@39ead9abd2af /]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.2 (Ootpa) [root@39ead9abd2af /]# ls / bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var [root@39ead9abd2af /]# ls /etc/yum.repos.d/ ubi.repo
参考