1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-12 04:23:00 +02:00
pgbackrest/test/vm/docker/u14-base

42 lines
1.4 KiB
Plaintext

# Ubuntu 14.04 Base Container
FROM ubuntu:14.04
# Get packages that make up apt-get download
# apt-get -dy install ??? --print-uris -qq | sed -n "s/'\([^ ]\+\)' \([^ ]\+\) \([^ ]\+\) MD5Sum:\([^ ]\+\)/wget -c \1/p"
# Install SSH
RUN apt-get -y install openssh-server
# Create postgres user and group
RUN groupadd -g5000 postgres
RUN adduser --ingroup=postgres --disabled-password --gecos "" postgres
# Add Postgres packages
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.5' >> /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RUN sudo apt-get update
# Create vagrant user
RUN addgroup admin
RUN adduser --ingroup=admin --disabled-password --gecos "" vagrant
RUN sed -i 's/^\%admin.*$/\%admin ALL\=\(ALL\) NOPASSWD\: ALL/' /etc/sudoers
# Suppress dpkg interactive output
RUN rm /etc/apt/apt.conf.d/70debconf
# Download Perl packages to be installed later
RUN apt-get -dy install libdbd-pg-perl libdbi-perl libnet-daemon-perl libplrpc-perl libpq5
# Download Postgres packages to be installed later
RUN apt-get -dy install postgresql-9.4
# Copy trusted SSH setup
COPY ssh/config /root/resource/.ssh/config
COPY ssh/id_rsa /root/resource/.ssh/id_rsa
COPY ssh/id_rsa.pub /root/resource/.ssh/authorized_keys
RUN chmod 700 /root/resource/.ssh
RUN chmod 600 /root/resource/.ssh/*
# Start SSH when container starts
ENTRYPOINT service ssh restart && bash