If you have problem with passwords, that could mean you are actually trying to connect to a different database.Make sure you don’t have anything running on that port, for example an other postgres directly on the host, not in containers.Make sure you don’t have an other container using the same port external port.Use the client provided by Docker Desktop: "/mnt/c/Program Files/Docker/Docker/resources/bin/docker" info.If you installed Docker from snap, that is worse. Follow the official documentation of Docker and install it from Docker’s own repository.If you need docker in the WSL distribution and not just the client.If you want to use Docker Desktop, don’t install the Docker client in the WSL distribution.So I don’t really understand what happened, but ths is what I can recommend: Runtimes: io.1.linux runc io.2ĭocker: Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:5432 -> 0.0.0.0:0: listen tcp 127.0.0.1:5432: bind: An attempt was made to access a socket in a way forbidden by its access permissions. WARNING: No blkio throttle.write_iops_device supportĪnd here it is from WSL: ❯ docker version WARNING: No blkio throttle.read_iops_device support WARNING: No blkio throttle.write_bps_device support WARNING: No blkio throttle.read_bps_device support Kernel Version: 5.10.102.1-microsoft-standard-WSL2 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Network: bridge host ipvlan macvlan null overlay Sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0) GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1īuildx: Docker Buildx (Docker Inc., v0.8.2)Ĭompose: Docker Compose (Docker Inc., v2.7.0)Įxtension: Manages Docker extensions (Docker Inc., v0.2.8) Here is the docker output on Windows: ❯ docker version Windows keep complaining: psql: error: FATAL: password authentication failed for user "postgres" Either way I can connect from WSL (sh) but can NOT from Windows (PowerShell). I did it both ways: starting docker from PowerShell or starting it from WSL sh. I am using Docker Desktop v4.11.1, Docker version 20.10.12, build 20.10.12-0ubuntu4 and Docker version 20.10.17, build 100c701 on Windows.ĭoes anybody have any idea what could be the issue? ❯ $env:PGPASSWORD="postgres" psql -host=localhost -username=postgres -command="SELECT version() " psql: error: FATAL: password authentication failed for user "postgres" The windows command line (powershell) fails connecting to the same container with: ❯ PGPASSWORD="postgres" psql -host=localhost -username=postgres postgres -c "SELECT version() " ❯ docker run -name pg14 -e POSTGRES_PASSWORD=postgres -detach -publish 5432:5432 postgres:14Īnd seems to publish the ports correctly:ĬONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESĤ9b69b9eaaf9 postgres:14 "docker-entrypoint.s…" 8 minutes ago Up 8 minutes 0.0.0.0:5432->5432/tcp pg14īut while I connect from WSL to that container without any issues: The docker container starts without complain:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |