PGadmin4 error :Unable to connect to server: - docker

I'm learning NestJS and I'm having some problems following the steps in the tutorial. As shown in the picture
enter image description here
I used this command to create a container on Docker
docker run --name postgres-nest -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
enter image description here
I tried the solution mentioned in this link
text
But after finding the address of this container and filling it into PGadmin again, I received a new errorenter image description here

I solved my own problem by reinstalled Docker.
After uninstalling Dokcer, I tried to check the occupancy of the locally mapped port 5432, and I found it was occupied by a program postgres.exe, so I closed the occupancy of the port by that program.
Reinstalled Docker and then followed the steps in the tutorial. Finally connected to the container in PGAdmin.
As a newbie I still don't understand the principle of it, but the goal was accomplished by mistake.

Related

How do you update a running docker image on digital ocean droplet? [duplicate]

This question already has answers here:
How to upgrade docker container after its image changed
(14 answers)
Closed last year.
I have a docker image running on port 3000 on my droplet on digital ocean.
I did some updates and created a new image and pushed it to my github packages.
I thought when I push the new image that the old one would just get overriden but Im getting an error saying
"Bind for 0.0.0.0:3000 failed: port is already allocated".
I run the following command when I get the above:
docker run -p 3000:3000 docker.pkg.github.com/UserName/Project/newImageName:1
This made me think that I could remove the old image and add the new one but that does not seem ideal but I have not found a command that can override/update to a new one.
Is this possible, and how?
Run the image using --rm parameter (which removes the container upon exit).
docker run --rm -p 3000:3000 docker.pkg.github.com/UserName/Project/newImageName:1
After exiting (stopping the container) you can docker pull to get the latest version of the image and then re-run

Docker tutorial 'Getting Started' doesn't work

I have Ubuntu 20.04, Mozilla Firefox 87.0, Google Chrome 89.0.4389.90.
I am trying to run the Docker Getting-started tutorial. I read a couple of posts from stack overflow to not avail. Also I checked this ToDo App (localhost:3000) shows no UI in Browser #9 and this enter link description here again to not avail. I do,
sudo docker build -t getting-started .
sudo docker run -dp 3000:3000 getting-started
and then when I go to http://localhost:3000 I get,
In Firefox,
in Chrome the following images alternate,
When I run, sudo docker ps -a I get,
Finally, do you suggest any Docker tutorial for beginners? I want to have enough understanding for Docker so that I can write scripts to manage docker images.
You might be building and running the Dockerfile outside the "app" directory which has this behaviour. As the tutorial says, first go to the app directory, create a Dockerfile there and then build and run. This should work.
3000:80 opens the tutorial because the default Dockerfile builds the docker/getting-started which is the tutorial.
Might be the problem something is blocking the port on your machine so try to Replace the port to 80 instead of 3000.
Change from
docker run -dp 3000:3000 getting-started
to
docker run -dp 3000:80 getting-started
and then open browser and hit http://localhost:3000
Answer 1 is correct but I would like to give a little explanation as to why you have to change "3000:3000" to "3000:80".
The port number before the colon represents the outgoing port and the port number after the colon represents the internal port inside the docker container.
"As the tutorial says, first go to the app directory, create a Dockerfile there and then build and run."
This solves the problem. If you build and run from the root - there is existing Dockerfile in there, it want work. Go to app folder, create Dockerfile with the content from the tutorial, build and run.

WhatIf Google Tensorboard Tutorial confusion

I am trying to use WhatIf to interpret a model and followed along this here:
https://github.com/tensorflow/tensorboard/tree/master/tensorboard/plugins/interactive_inference#what-do-i-need-to-use-it
In particular I followed this tutorial: https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/interactive_inference/WIT_from_scratch.ipynb
However parts of it are poorly written. I finally got my docker to spin up a localhost at port 8005 with this command: docker run -p 8500:8500 --mount type=bind,source="$(pwd)/mod
els/iris",target=/models/iris -e MODEL_NAME=iris -t tensorflow
/serving which output this: I tensorflow_serving/model_servers/server.cc:301] Exporting HTTP/REST API at:localhost:8501 ...
[evhttp_server.cc : 235] RAW: Entering the event loop ...
I then in my Anaconda command line I ran tensorboard --logdir . as the tutorial told me to which outputted this: TensorBoard 1.9.0 at http://DESKTOP-[serial_code_for_my_computer]:6006 (Press CTRL+C to quit)
The tutorial tells me to "Navigate to http://localhost:6006/#whatif&inferenceAddress=localhost%3A8500&modelName=iris"
However nothing loads when I do this. I suspect there is some disconnect between my Docker which is hosting at localhost:8500 and my tensorboard which is at DESKTOP-[computer_serial]:6006? This last URL loads an empty tensorboard with nothing in it but even when I add #whatif&inferenceAddress=localhost%3A8500&modelName=iris to this DESKTOP URL it fails to load anything.
Thank you for any help that can be provided. I look forward to being able to use WhatIf!
In my case, the model name you enter to both of docker command and localhost address should've been matched. For me, the tensorboard loaded successfully the instances but not other functionalities, and made requestnetworkerror. Hope it helps.

Docker run does not deploy

So we followed the Docker get started tutorial
(https://docs.docker.com/get-started/part2/). The build works, the command
docker run -p 4000:80 friendlyhello
works but when we go to http://localhost:4000, nothing is reached. We just followed the tutorial step by step but don't see anything.
Yes we also went to localhost:4001.
Is this perhaps something that has to do witht the message "system pool is not available on windows"?
Here's a screenshot of our docker output
Firstly talking about the issue that you've pointed out yourself, this is identified as an issue that can't be fixed for Windows.
Please try downgrading to version 1.12.x so that these warnings do not pop-up anymore. This solution is found working for most of us.
level-info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
Coming to the main issue that you're facing, which is as follows:
Error response from daemon: driver failed programming external connectivity on endpoint objective_joliot
This says that the port 4000 is already in use on Docker VM or possibly on your system. You can either stop whatever is running on that port or change the port used in your Docker command.
To change to the external port 8080, use:
docker run -d -p 8080:80 --name objective_joliot nginx
Hope this helps!!!

How to see where my website is running after creating a container using docker image?

I have created a container using an image which hosts a simple tomcat application.
I used this command:
docker run -d -p 7992:80 <Image_Name>
It ran successfully and gave me the container ID.
Now I have tried hitting http://<host_ip>:7992 as well as http://<container_id> URL. But it keeps saying site cannot be reached.
Am I hitting the wrong IP or what? Where will I see my website?
Please comment if any more information is required.
You can try
docker port <container_id>

Resources