我在容器世界中很新。
我正在尝试在docker_composer的帮助下启动ora2pg并运行,但出现以下错误消息:



我的docker-composer.yml如下:

version: "3.7"
services:
 postgresql:
  restart: always
  image: postgres
  container_name: "postgres_db"
  ports:
  - "5432:5432"
  environment:
  - DEBUG=false
  - DB_USER=
  - DB_PASS=
  - DB_NAME=
  - DB_TEMPLATE=
  - DB_EXTENSION=
  - REPLICATION_MODE=
  - REPLICATION_USER=
  - REPLICATION_PASS=
  - REPLICATION_SSLMODE=
  volumes:
  - ./postgres/data:/var/lib/postgresql/data
  - ./postgres/initdb:/docker-entrypoint-initdb.d

 ora2pg:
  image: flockers/ora2pg
  container_name: "ora2pg_client"
  environment:
  - DB_HOST=127.0.0.1
  - DB_SID=xe
  - ORA2PG_USER=MAX
  - DB_PASS=MAX
  volumes:
  - ./ora2pg/export:/export

注意:我已经在同一台计算机上有一个Oracle数据库。

谢谢!

最佳答案

如果查看Dockerfile的https://hub.docker.com/r/flockers/ora2pg/dockerfile flockers/ora2pg,则CMDentrypoint丢失。

 ora2pg:
  image: flockers/ora2pg
  container_name: "ora2pg_client"
  environment:
  - DB_HOST=127.0.0.1
  - DB_SID=xe
  - ORA2PG_USER=MAX
  - DB_PASS=MAX
  volumes:
  - ./ora2pg/export:/export
  command: tail -f /dev/null

因此,在这里command: tail -f /dev/null只会使您的容器保持运行状态,并且不会执行任何操作,请替换为命令。

09-30 11:49