2019-02-12 13:33:42 +01:00
|
|
|
FROM photon:2.0
|
2018-04-01 17:53:21 +02:00
|
|
|
|
2018-06-01 08:58:43 +02:00
|
|
|
ENV PGDATA /var/lib/postgresql/data
|
|
|
|
|
|
|
|
## have both mysql and pgsql installed.
|
2018-08-08 07:58:01 +02:00
|
|
|
RUN tdnf distro-sync -y \
|
2019-02-13 11:42:20 +01:00
|
|
|
&& tdnf remove -y toybox \
|
|
|
|
&& tdnf install -y sed shadow procps-ng gawk gzip sudo net-tools glibc-i18n >> /dev/null\
|
2019-05-07 07:36:36 +02:00
|
|
|
&& tdnf install -y python2 python2-devel python-pip gcc PyYAML python-jinja2 \
|
2019-02-26 03:58:05 +01:00
|
|
|
linux-api-headers glibc-devel binutils zlib-devel openssl-devel postgresql python-psycopg2 >> /dev/null \
|
2019-05-07 07:36:36 +02:00
|
|
|
&& pip install alembic \
|
2018-06-01 08:58:43 +02:00
|
|
|
&& mkdir /docker-entrypoint-initdb.d /docker-entrypoint-updatedb.d \
|
2019-05-07 07:36:36 +02:00
|
|
|
&& chmod 777 /docker-entrypoint-initdb.d /docker-entrypoint-updatedb.d \
|
2018-06-01 08:58:43 +02:00
|
|
|
&& mkdir -p /harbor-migration \
|
|
|
|
&& touch /etc/localtime.bak \
|
|
|
|
&& groupadd -r postgres --gid=999 \
|
|
|
|
&& useradd -r -g postgres --uid=999 postgres \
|
|
|
|
&& mkdir -p /run/postgresql \
|
|
|
|
&& chown -R postgres:postgres /run/postgresql \
|
|
|
|
&& chmod 2777 /run/postgresql \
|
|
|
|
&& mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" \
|
|
|
|
&& sed -i "s|#listen_addresses = 'localhost'.*|listen_addresses = '*'|g" /usr/share/postgresql/postgresql.conf.sample \
|
|
|
|
&& sed -i "s|#unix_socket_directories = '/tmp'.*|unix_socket_directories = '/run/postgresql'|g" /usr/share/postgresql/postgresql.conf.sample \
|
|
|
|
&& touch /usr/share/locale/locale.alias \
|
|
|
|
&& locale-gen.sh en_US.UTF-8 \
|
|
|
|
&& tdnf clean all
|
|
|
|
|
|
|
|
VOLUME /var/lib/postgresql/data
|
2018-04-01 17:53:21 +02:00
|
|
|
|
|
|
|
WORKDIR /harbor-migration
|
|
|
|
|
|
|
|
COPY ./ ./
|
|
|
|
|
|
|
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|