创建服务失败并显示“未指定命令”

Dax*_*Dax 2 docker dockerfile docker-compose

我对容器世界非常陌生。我试图在 docker_composer 的帮助下启动并运行 ora2pg,但收到以下错误消息:

postgres_db 是最新的

创建ora2pg_client ...错误

错误:对于 ora2pg_client 无法为服务 ora2pg 创建容器:未指定命令

错误:对于 ora2pg 无法为服务 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
Run Code Online (Sandbox Code Playgroud)

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

谢谢你!

Adi*_*iii 6

如果您查看 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
Run Code Online (Sandbox Code Playgroud)

所以这里command: tail -f /dev/null它只会让你的容器保持运行,不会做任何事情,用你的命令替换。