PodmanでRedis Commanderを起動してみる


環境

Fedora CoreOS 31.20200113.3.1
Podman 1.7.0
Podman Compose 0.1.5

準備

$ sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
$ sudo reboot
$ sudo rpm-ostree install python3 -r
$ sudo pip3 install podman-compose
$ mkdir -p ~/.local/bin
$ curl -o ~/.local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py
$ chmod +x ~/.local/bin/podman-compose

$ mkdir -p dkwork/redis
cd dkwork/redis
vi docker-compose.yml
docker-compose.yml
version: '3.7'
services:
  redis:
    # container_nameをredisにしたら
    # Error: name redis is in use: container already exists
    # のエラーになったので別名にしています。
    container_name: redis1
    image: redis:5.0.7
    ports:
      - 6379:6379

  redis-commander:
    container_name: redis-commander
    hostname: redis-commander
    image: rediscommander/redis-commander:redis-commander-210
    restart: always
    environment:
      - REDIS_HOSTS=local:redis:6379
    ports:
      - 8081:8081

実行

$ podman-compose up -d

$ podman ps

CONTAINER ID  IMAGE                                                         COMMAND               CREATED        STATUS            PORTS                   NAMES
05adabf75a3c  docker.io/rediscommander/redis-commander:redis-commander-210  /redis-commander/...  8 minutes ago  Up 8 minutes ago  0.0.0.0:6379->6379/tcp  redis-commander
21de78b8c8c3  docker.io/library/redis:5.0.7                                 bash -c mkdir -p ...  8 minutes ago  Up 8 minutes ago  0.0.0.0:6379->6379/tcp  redis1

$ podman images | grep redis

docker.io/library/redis                    5.0.7                 44d36d2c2374   15 hours ago    102 MB
docker.io/rediscommander/redis-commander   redis-commander-210   a88a50c04b16   11 months ago   109 MB

参考URL

Podman
Podman Compose