Skip to content

Commit

Permalink
Improve organization of test Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Edgin committed Jul 9, 2023
1 parent 33fd313 commit 192520e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ USER root

ARG DEBIAN_FRONTEND=noninteractive

COPY unattended_installation.json /tmp

### Installed required packages
RUN apt-get --quiet update && \
apt-get --quiet --yes upgrade && \
apt-get --quiet --yes install irods-database-plugin-postgres postgresql postgresql-contrib && \
apt-get clean && \
### Create ICAT DB
sudo --user postgres \
apt-get clean

### Initialize server
COPY unattended_installation.json /tmp
RUN sudo --user postgres \
/usr/lib/postgresql/10/bin/pg_ctl \
--log=/var/log/postgresql/postgresql-10-main.log \
--options='--config_file=/etc/postgresql/10/main/postgresql.conf' \
Expand All @@ -20,7 +21,6 @@ RUN apt-get --quiet update && \
sudo --user postgres psql --command="CREATE USER irods WITH PASSWORD 'testpassword'" && \
sudo --user postgres psql --command='CREATE DATABASE "ICAT"' && \
sudo --user postgres psql --command='GRANT ALL PRIVILEGES ON DATABASE "ICAT" TO irods' && \
### Initialize server
python3 /var/lib/irods/scripts/setup_irods.py --verbose \
--json_configuration_file=/tmp/unattended_installation.json && \
sudo --user postgres \
Expand All @@ -29,10 +29,9 @@ RUN apt-get --quiet update && \

### Install DBMS management script
COPY control-dbms.sh /control-dbms

RUN chown irods:irods /control-dbms && \
chmod ug+x /control-dbms && \
echo 'irods ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/irods
echo 'irods ALL=(postgres) NOPASSWD: /usr/lib/postgresql/10/bin/pg_ctl' > /etc/sudoers.d/irods

USER irods

Expand Down

0 comments on commit 192520e

Please sign in to comment.