title: How to run Postgres in a docker Alpine Linux container?
body: <p>I'm trying to get Postgresql 10.0 working in a docker container. I have the following Dockerfile:</p>
  <pre><code>FROM postgres:10.0-alpine
  
  RUN apk add openrc --no-cache
  
  USER postgres
  
  RUN /etc/init.d/postgresql start
  RUN psql --command &quot;IF NOT EXISTS (SELECT FROM pg_catalog.pg_user WHERE usename = 'user') THEN CREATE USER user WITH SUPERUSER ENCRYPTED PASSWORD 'password'; END IF;&quot;
  RUN createdb main
  
  EXPOSE 5432
    
  VOLUME  [&quot;/etc/postgresql&quot;, &quot;/var/log/postgresql&quot;, &quot;/var/lib/postgresql&quot;]
  
  CMD [&quot;/usr/lib/postgresql/10.0/bin/postgres&quot;, &quot;-D&quot;, &quot;/var/lib/postgresql/10.0/main&quot;, &quot;-c&quot;, &quot;config_file=/etc/postgresql/10.0/main/postgresql.conf&quot;]
  </code></pre>
  <p>I got following error:</p>
  <pre><code>/bin/sh: /etc/init.d/postgresql: not found
  </code></pre>
  <p>Seems that <code>/etc/init.d/postgresql</code> is really missing. What am I doing wrong?</p>