You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i used this command to create postgres container docker run -d -p 5432:5432 --name posgres1 postgres -v postgres-data:/var/lib/postgresql/data
but when try to connect to the container the container stopped and When run docker logs i got this logs
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok
Success. You can now start the database server using:
WARNING: No password has been set for the database.
This will allow anyone with access to the
Postgres port to access your database. In
Docker's default configuration, this is
effectively any other container on the same
system.
Use "-e POSTGRES_PASSWORD=password" to set
it in "docker run".
waiting for server to start....2019-06-21 19:06:12.680 UTC [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-06-21 19:06:12.783 UTC [48] LOG: could not resolve "localhost": Name or service not known
2019-06-21 19:06:12.783 UTC [48] LOG: disabling statistics collector for lack of working socket
2019-06-21 19:06:12.783 UTC [48] WARNING: autovacuum not started because of misconfiguration
2019-06-21 19:06:12.783 UTC [48] HINT: Enable the "track_counts" option.
2019-06-21 19:06:12.794 UTC [49] LOG: database system was shut down at 2019-06-21 19:06:08 UTC
2019-06-21 19:06:12.826 UTC [48] LOG: database system is ready to accept connections
done
server started
2019-06-21 19:06:12.862 UTC [48] LOG: received fast shutdown request
waiting for server to shut down....2019-06-21 19:06:12.866 UTC [48] LOG: aborting any active transactions
2019-06-21 19:06:12.868 UTC [48] LOG: background worker "logical replication launcher" (PID 53) exited with exit code 1
2019-06-21 19:06:12.869 UTC [50] LOG: shutting down
2019-06-21 19:06:12.917 UTC [48] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
postgres: invalid option -- 'v'
Try "postgres --help" for more information.
The text was updated successfully, but these errors were encountered:
docker run -d -p 5432:5432 --name posgres1 postgres -v postgres-data:/var/lib/postgresql/data
Your syntax is off; the -v option to docker run is after the image, so the command is treating that as an argument for the image
$ docker run"docker run" requires at least 1 argument.See 'docker run --help'.Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
So move any options to docker run before you give it the image: docker run -d -p 5432:5432 --name posgres1 -v postgres-data:/var/lib/postgresql/data postgres
i used this command to create postgres container
docker run -d -p 5432:5432 --name posgres1 postgres -v postgres-data:/var/lib/postgresql/data
but when try to connect to the container the container stopped and When run docker logs i got this logs
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok
Success. You can now start the database server using:
WARNING: No password has been set for the database.
This will allow anyone with access to the
Postgres port to access your database. In
Docker's default configuration, this is
effectively any other container on the same
system.
waiting for server to start....2019-06-21 19:06:12.680 UTC [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-06-21 19:06:12.783 UTC [48] LOG: could not resolve "localhost": Name or service not known
2019-06-21 19:06:12.783 UTC [48] LOG: disabling statistics collector for lack of working socket
2019-06-21 19:06:12.783 UTC [48] WARNING: autovacuum not started because of misconfiguration
2019-06-21 19:06:12.783 UTC [48] HINT: Enable the "track_counts" option.
2019-06-21 19:06:12.794 UTC [49] LOG: database system was shut down at 2019-06-21 19:06:08 UTC
2019-06-21 19:06:12.826 UTC [48] LOG: database system is ready to accept connections
done
server started
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2019-06-21 19:06:12.862 UTC [48] LOG: received fast shutdown request
waiting for server to shut down....2019-06-21 19:06:12.866 UTC [48] LOG: aborting any active transactions
2019-06-21 19:06:12.868 UTC [48] LOG: background worker "logical replication launcher" (PID 53) exited with exit code 1
2019-06-21 19:06:12.869 UTC [50] LOG: shutting down
2019-06-21 19:06:12.917 UTC [48] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
postgres: invalid option -- 'v'
Try "postgres --help" for more information.
The text was updated successfully, but these errors were encountered: