pull access denied for mypostgres, repository does not exist or may require 'docker login' : how to name 'mypostgres'

Viewed 27

I have Ubuntu 22.04 and run next command:

docker run -d mypostgres -e POSTGRES_PASSWORD=1111 postgres -c shared_buffers=256MB -c max_connections=200

and I got following answer:

Unable to find image 'mypostgres:latest' locally docker: Error response from daemon: pull access denied for mypostgres, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

So what is the correct name for 'mypostgres'? Can I write here the occasional name that I want?

2 Answers

You should use postgres instead if you want to download the image from dockerhub. If you want specific version you can use tags provided on the dockerhub page ie. postgres:14.5

What you are missing here is --name switch before mypostgres You can use --name switch to name your container

Full command:

docker run -d --name mypostgres -e POSTGRES_PASSWORD=1111 postgres -c shared_buffers=256MB -c max_connections=200

--name before mypostgres , because docker understood that you want an image called mypostgres not a postgres images. and didn't find an official image with that name.

Related