[Rt-commit] 02/07: Convert Dockerfile options to build arguments
Brett Smith
brett at bestpractical.com
Thu Aug 5 20:00:44 UTC 2021
This is an automated email from the git hooks/post-receive script.
brett pushed a commit to branch 5.0/github-actions-tests
in repository rtir.
commit fd7620132e5075b342a44de830462c8929cecd5b
Author: Brett Smith <brett at bestpractical.com>
AuthorDate: Thu Aug 5 11:02:45 2021 -0400
Convert Dockerfile options to build arguments
In order to support different database configurations, it needs to be
possible to set these variables at image build time, not just container
runtime. Converting these options to build arguments is the most natural
way to do that. We capture the variables that the RTIR test runner
actually needs at the end of the build.
---
Dockerfile | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 52b18a31..21bcfbf7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,23 +3,26 @@ FROM bpssysadmin/rt-base-debian-stretch
LABEL maintainer="Best Practical Solutions <contact at bestpractical.com>"
# Valid values are RT branches like 5.0-trunk or version tags like rt-4.4.4
-ENV RT_VERSION 5.0-trunk
-ENV RT_TEST_DEVEL 1
-ENV RT_DBA_USER root
-ENV RT_DBA_PASSWORD password
-ENV RT_TEST_DB_HOST=172.17.0.2
-ENV RT_TEST_RT_HOST=172.17.0.3
+ARG RT_VERSION=5.0-trunk
+ARG RT_DBA_USER=root
+ARG RT_DBA_PASSWORD=password
+ARG RT_TEST_DB_HOST=172.17.0.2
+ARG RT_TEST_RT_HOST=172.17.0.3
RUN cd /usr/local/src \
&& git clone https://github.com/bestpractical/rt.git \
&& cd rt \
&& git checkout $RT_VERSION \
&& ./configure.ac \
- --enable-developer --enable-gd --enable-graphviz --with-db-host=172.17.0.2 --with-db-rt-host=172.17.0.3\
+ --enable-developer --enable-gd --enable-graphviz --with-db-host="$RT_TEST_DB_HOST" --with-db-rt-host="$RT_TEST_RT_HOST" \
&& make install \
- && /usr/bin/perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --dba-password=password \
+ && /usr/bin/perl -I/opt/rt5/local/lib -I/opt/rt5/lib sbin/rt-setup-database --action init --dba="$RT_DBA_USER" --dba-password="$RT_DBA_PASSWORD" \
&& rm -rf /usr/local/src/*
RUN cpanm Net::Domain::TLD Net::Whois::RIPE Parse::BooleanLogic
+ENV RT_DBA_USER="$RT_DBA_USER"
+ENV RT_DBA_PASSWORD="$RT_DBA_PASSWORD"
+ENV RT_TEST_DEVEL=1
+
CMD tail -f /dev/null
--
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.
More information about the rt-commit
mailing list