version: '3' services: oracle: image: wnameless/oracle-xe-11g-r2 container_name: oracle11gr2 environment: - 'NLS_LANG=AMERICAN_AMERICA.AL32UTF8' volumes: - "./create.sql:/docker-entrypoint-initdb.d/create.sql" ports: - "1521:1521"
将sql挂载到/docker-entrypoint-initdb.d/目录下,oracle启动会自动执行sql(需保证sql正确性,如未启动可以查看docker容器启动log)
标签:compose,启动,oracle,sql,oracle11,docker From: https://www.cnblogs.com/goPush/p/17393843.html