Why is OracleDB locking up in Docker?
IF that is actually your script, then after you connect "/ as sysdba", then sqlplus is simply waiting for input.  It doesn't see the 'alter session', etc, because those aren't being redirected into sqlplus.  Rather, they are simply treated as the next command for the shell to process after sqlplus exits.  

Try this:

sqlplus / as sysdba &lt;&lt;EOF 
alter session set "_ORACLE_SCRIPT"=true;
create user username identified by 12345; 
grant dba to username; exit
EOF


BTW, you should not be using 'as sysdba' if you can accomplish the same thing with a less privileged user, such as SYSTEM.  Connecting to oracle as SYS is like connecting to Linux as root.  You are running with scissors, knives, and blowtorches, all without a net.