Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull specific version of Docker Postgres Image?

I am new to docker area. I did docker pull postgres and docker pull postgres:9.5.4 , in both cases it pulling latest image as postgres 10.1 (see below).

PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18) 6.3.0 20170516, 64-bit

I would like to pull only 9.5.4 version of postgres image from dockers hub.

Even pulled 9.5.4 or 9.5.10 showing always postgres 10.1 postgres 9.5.4 postgres 9.5.10

like image 424
Sumit Arora Avatar asked Jan 10 '18 22:01

Sumit Arora


People also ask

What version of Postgres is my docker container?

Check Postgres Version from SQL Shell Type the following SQL statement within the prompt to check the current version: SELECT version(); The resulting output provides the full version and system information for the PostgreSQL server.

How can I pull the docker image?

Pull a repository with multiple images By default, docker pull pulls a single image from the registry. A repository can contain multiple images. To pull all images from a repository, provide the -a (or --all-tags ) option when using docker pull .


1 Answers

Based on your screenshots, you seem to think that pulling postgres:9.5.10 followed by docker start postgres will run the thing you just pulled. This is incorrect - it's restarting an older container that had previously run on your system.

Try this:

docker run postgres:9.5.10
like image 92
mkasberg Avatar answered Oct 07 '22 08:10

mkasberg