gvenzl / oci-oracle-free

Build scripts for Oracle Database FREE container/docker images
Apache License 2.0
113 stars 28 forks source link

Connection issue on Github actions #33

Open hantsy opened 6 months ago

hantsy commented 6 months ago

I have tried to use https://github.com/marketplace/actions/setup-oracle-db-free and custom docker compose to serve an oracle db, when connecting to db against localhost host, I got the error like this:

 Caused by: org.hibernate.service.spi.ServiceException: 
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 
due to: io.vertx.oracleclient.OracleException: ORA-17868: 
Unknown host specified.: oracle: Temporary failure in name resolution

The Github task I have tried like this.

- uses: gvenzl/setup-oracle-free@v1
 with:
   oracle-database: blogdb
   app-user: testUser
   app-user-password: testPassword    

And the docker compose file use this docker image like this.

version: '3.7' # specify docker-compose version

services:
  oracle:
    # see https://www.oracle.com/database/technologies/appdev/xe.html
    image: gvenzl/oracle-free:23-slim
    ports:
      - "1521:1521"
    restart: always
    environment:
      ORACLE_PASSWORD: sysPassword
      ORACLE_DATABASE: blogdb
      APP_USER: testUser
      APP_USER_PASSWORD: testPassword
    volumes:
      - ./data:/opt/oracle/oradata

And Github actions step to call it.

- name: Set up Oracle(via Docker Compose)
  run: |
    cd hibernate-reactive-mutiny-oracle
    docker-compose up -d
    sleep 10
    docker ps -a

The JDBC URL I used to connect this db is jdbc:oracle:thin://localhost:1521/blogdb.