# 使用podman-compose启动应用，出现容器之间不能使用容器名访问的错误

**URL:** <https://forum.gitea.com/t/podman-compose/5408>\
**Category:** 中文求助(Chinese Only)\
**Created:** [June 28, 2022, 8:33am UTC](https://forum.gitea.com/t/podman-compose/5408 "2022-06-28T08:33:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roamergu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/roamergu/32/2766_2.png) [@roamergu](https://forum.gitea.com/u/roamergu)\
**Post date:** [June 28, 2022, 8:33am UTC](https://forum.gitea.com/t/podman-compose/5408/1 "2022-06-28T08:33:58Z")

</div>

```auto
version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:1.17-dev-linux-amd64-rootless
    container_name: gitea
    links:
     - "db:database"
    environment:
     - USER_UID=1000
     - USER_GID=1000
     - DB_TYPE=postgres
     - DB_HOST=db:5432
     - DB_NAME=gitea
     - DB_USER=gitea
     - DB_PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      #- /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "2222:22"
    depends_on:
      - db

  db:
    image: postgres:14
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - ./postgres:/var/lib/postgresql/data

```

启动以后可以正常访问页面，但安装步骤失败，提示无法解析db。使用db容器的IP地址访问正常。系统为rockylinux 8.6,firwalld与selinux均已经禁用。

---

<div class="post-metadata">

**Author:** ![roamergu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/roamergu/32/2766_2.png) [@roamergu](https://forum.gitea.com/u/roamergu)\
**Post date:** [June 29, 2022, 2:11am UTC](https://forum.gitea.com/t/podman-compose/5408/2 "2022-06-29T02:11:36Z")

</div>

容器运行时换成docker-ce一切正常……
