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 beforemypostgres
You can use--name
switch to name your containerFull command:
–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.