Psycopg2 for Amazon Linux & Python 3.6 Build from source and static link. docker build -t psycopg2-builder . docker run psycopg2-builder > psycopg2.tar