Don't use supervisor and ssh in postgis container

pull/1/head
Tim Sutton 2014-08-04 14:53:38 +02:00
rodzic 865e7ef76f
commit ae48998330
4 zmienionych plików z 5 dodań i 37 usunięć

Wyświetl plik

@ -3,5 +3,5 @@
# use apt-cacher in your image build out (and the
# Subsequent running container.
#Acquire::http { Proxy "http://192.168.2.3:3142"; };
#Acquire::http { Proxy "http://192.168.2.9:3142"; };
#Acquire::http { Proxy "http://192.168.1.13:3142"; };

Wyświetl plik

@ -14,25 +14,13 @@ ADD 71-apt-cacher-ng /etc/apt/apt.conf.d/71-apt-cacher-ng
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list
RUN apt-get -y update
# socat can be used to proxy an external port and make it look like it is local
RUN apt-get -y install ca-certificates socat openssh-server supervisor rpl pwgen
RUN mkdir /var/run/sshd
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
# Ubuntu 14.04 by default only allows non pwd based root login
# We disable that but also create an .ssh dir so you can copy
# up your key. NOTE: This is not a particularly robust setup
# security wise and we recommend to NOT expose ssh as a public
# service.
RUN rpl "PermitRootLogin without-password" "PermitRootLogin yes" /etc/ssh/sshd_config
RUN mkdir /root/.ssh
RUN chmod o-rwx /root/.ssh
RUN apt-get -y install ca-certificates rpl pwgen
#-------------Application Specific Stuff ----------------------------------------------------
# Next line a workaround for https://github.com/dotcloud/docker/issues/963
RUN apt-get install -y postgresql-9.3-postgis-2.1
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
RUN echo "host all all 172.17.0.0/16 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
RUN service postgresql start && /bin/su postgres -c "createuser -d -s -r -l docker" && /bin/su postgres -c "psql postgres -c \"ALTER USER docker WITH ENCRYPTED PASSWORD 'docker'\"" && service postgresql stop
# Listen on all ip addresses
RUN echo "listen_addresses = '*'" >> /etc/postgresql/9.3/main/postgresql.conf
@ -55,8 +43,4 @@ RUN /setup.sh
ADD start-postgis.sh /start-postgis.sh
RUN chmod 0755 /start-postgis.sh
# Called on first run of docker - will run supervisor
ADD start.sh /start.sh
RUN chmod 0755 /start.sh
CMD /start.sh
CMD /start-postgis.sh

Wyświetl plik

@ -1 +1 @@
docker.io build -t kartoza/postgis .
docker build -t kartoza/postgis .

Wyświetl plik

@ -1,16 +0,0 @@
#!/bin/bash
# Put any tasks you would like to have carried
# out when the container is first created here
# Set the root passwd - grep docker logs for it
ROOT_PASSWORD=`pwgen -c -n -1 12`
echo "root:$ROOT_PASSWORD" | chpasswd
echo "root login password: $ROOT_PASSWORD"
# Also echo out the pg password written to
# /PGPASSWORD.txt when the image was made
# by start-postgres.sh
# Launch supervisor
supervisord -n