Docker Postgresql Error: line 105: cannot create temp file for here-document: Permission denied

I am trying to run a postgresql instance in docker using the alpine images like this

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword postgres:9-alpine

  • AWS ECS container logs design pattern
  • Docker-compose cannot find Java
  • How to allocate percentage of system resources to Docker?
  • Mounting volumes before executing commands with docker-compose and boot2docker
  • Start an existing docker ubuntu container [duplicate]
  • reading IP address of a host machine inside a docker container
  • but it gives me the following output

    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 ... sh: locale: not found
    No usable system locales were found.
    Use the option "--debug" to see details.
    syncing data to disk ... ok
    Success. You can now start the database server using:
        pg_ctl -D /var/lib/postgresql/data -l logfile start
    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.
    waiting for server to start....LOG:  database system was shut down at 2017-02-06 07:43:26 UTC
    LOG:  MultiXact member wraparound protections are now enabled
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
    server started
    / line 105: cannot create temp file for here-document: Permission denied

    Am I doing something wrong? or Is this a bug in the container?
    How do i fix this?

    Thanks for all your help.

  • What is the difference between import and load in Docker?
  • Docker Compose Rails Tutorial: Where did the files go?
  • Development and production with docker with multiple sites
  • ffmpeg failed - 455 Method Not Valid in This State
  • Building on a docker image that sets user to an unprivileged user
  • 'nutc': unknown terminal type. docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.