Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose creates container nfldb_postgres_1 not nfldb-postgres #14

Open
a-camarillo opened this issue Dec 3, 2020 · 0 comments
Open

Comments

@a-camarillo
Copy link

Running Ubuntu 20.04.1 on WSL2.

Following along with the README.MD:

After cloning the repository and unzipping the zip folder, running docker-compose up -d postgres returns

Creating network "nfldb_default" with the default driver 
Creating nfldb_postgres_1... done

Expected: Creating nfldb-postgres... done

Running docker ps:

docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
b99289fc4048        postgres            "docker-entrypoint.s…"   2 hours ago         Up 2 hours          5432/tcp            nfldb_postgres_1

This does not cause any issues until the python cli:

>>>import nfldb
>>>db = nfldb.connect()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/code/nfldb/db.py", line 142, in connect
    host=host, port=port)
  File "/virtualenv/lib/python3.7/site-packages/psycopg2/__init__.py", line 127, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "nfldb-postgres" to address: Name or service not known

Looked through the docker-compose.yml file and not sure why it would name the container nfldb_postgres_1 but the issue might be with psycopg2 rather than the docker file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant