Unable to connecting to the PSQL Client


I installed Docker PSQL image(https://docs.docker.com/engine/examples/postgresql_service/) on my EC2 server…it is working fine in ec2 CLI…while I am connecting to PSQL client it is showing the below error…

I Opened Port 5432…Inside docker shell, I am unable to install vi (or) nano to edit the /etc/postgresql/9.3/main/PostgreSQL.conf (or)pg_hbs.conf files and while updating with apt-get update it is showing the below error image…could you help me in resolving this?

Thanks in advance.