Unable to connect to an Oracle 12c Docker container
&quot;Semi-official&quot; images available on hub.docker.com
docker image ls
REPOSITORY         TAG           IMAGE ID       CREATED       SIZE
gvenzl/oracle-xe   18            e1d4dae1771b   4 days ago    3.69GB
gvenzl/oracle-xe   18.4.0        e1d4dae1771b   4 days ago    3.69GB
gvenzl/oracle-xe   latest        e1d4dae1771b   4 days ago    3.69GB
gvenzl/oracle-xe   18-full       13085168429b   12 days ago   6.36GB
gvenzl/oracle-xe   18.4.0-full   13085168429b   12 days ago   6.36GB
gvenzl/oracle-xe   full          13085168429b   12 days ago   6.36GB

docker-compose.yml for persistent database.
version: '3.8'
services:
  database:
    image: gvenzl/oracle-xe:18
    container_name: oracle
    environment:
      - ORACLE_PASSWORD=Welcome_1
    volumes:
      - type: volume
        source: oradata
        target: /opt/oracle/oradata
    ports:
      - 1521:1521
    networks:
      - dbnet
    healthcheck:
      test: sql -L -S sys/Welcome_1@localhost:1521/XEPDB1 as sysdba &lt; /dev/null |grep 'ORA-'; if [[ $$? == 1 ]]; then echo 0; else echo 1; fi
      interval: 1m
      timeout: 10s
      retries: 20
      start_period: 40s
networks:
  dbnet:
volumes:
   oradata:
     driver: local
     driver_opts:
       type: none
       device: $PWD/oradata
       o: bind

Note, make sure &quot;oradata&quot; is rw by oracle user inside container.
Best of luck!