diff --git a/Dockerfile b/Dockerfile index ab81472..4350e0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,19 +11,19 @@ RUN dnf -y upgrade-minimal && \ # it all every time we change the requirements :-/ # install Java -RUN url="https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz" ; \ - curl -s "$url" | tar -C /usr/bin/ -xz +ARG JAVA_URL=https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz +RUN curl -s "$JAVA_URL" | tar -xz -C /usr/bin/ # install Firefox -RUN dnf install -y wget bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \ - wget -qO- "https://ftp.mozilla.org/pub/firefox/releases/94.0.2/linux-x86_64/en-US/firefox-94.0.2.tar.bz2" \ - | tar -C /usr/local/ -jx && \ +ARG FIREFOX_URL=https://ftp.mozilla.org/pub/firefox/releases/94.0.2/linux-x86_64/en-US/firefox-94.0.2.tar.bz2 +RUN dnf install -y bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \ + curl -s "$FIREFOX_URL" | tar -jx -C /usr/local/ && \ ln -s /usr/local/firefox/firefox /usr/bin/firefox && \ echo "exclude=firefox" >>/etc/dnf/dnf.conf # install geckodriver -RUN curl -sL "https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz" \ - | tar -C /usr/bin/ -xz +ARG GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz +RUN curl -sL "$GECKODRIVER_URL" | tar -xz -C /usr/bin/ # clean up RUN dnf clean all diff --git a/run-container.sh b/run-container.sh index 948be08..a3c7066 100755 --- a/run-container.sh +++ b/run-container.sh @@ -19,6 +19,7 @@ function main CONTAINER_NAME=vasl-templates DETACH= NO_BUILD= + BUILD_ARGS= BUILD_NETWORK= RUN_NETWORK= CONTROL_TESTS_PORT= @@ -30,7 +31,7 @@ function main print_help exit 0 fi - params="$(getopt -o p:v:e:k:t:d -l port:,control-tests-port:,vassal:,vasl:,vasl-extensions:,boards:,chapter-h:,template-pack:,user-files:,tag:,name:,detach,no-build,build-network:,run-network:,test-data-vassal:,test-data-vasl-mods:,help --name "$0" -- "$@")" + params="$(getopt -o p:v:e:k:t:d -l port:,control-tests-port:,vassal:,vasl:,vasl-extensions:,boards:,chapter-h:,template-pack:,user-files:,tag:,name:,detach,no-build,build-arg:,build-network:,run-network:,test-data-vassal:,test-data-vasl-mods:,help --name "$0" -- "$@")" if [ $? -ne 0 ]; then exit 1; fi eval set -- "$params" while true; do @@ -71,6 +72,9 @@ function main --no-build ) NO_BUILD=1 shift 1 ;; + --build-arg ) + BUILD_ARGS="$BUILD_ARGS --build-arg $2" + shift 2 ;; --build-network ) # FUDGE! We sometimes can't get out to the internet from the container (DNS problems) using the default # "bridge" network, so we offer the option of using an alternate network (e.g. "host"). @@ -187,7 +191,7 @@ function main # check if testing has been enabled if [ -n "$CONTROL_TESTS_PORT" ]; then - CONTROL_TESTS_PORT_BUILD="--build-arg CONTROL_TESTS_PORT=$CONTROL_TESTS_PORT" + BUILD_ARGS="$BUILD_ARGS --build-arg CONTROL_TESTS_PORT=$CONTROL_TESTS_PORT" CONTROL_TESTS_PORT_RUN="--env CONTROL_TESTS_PORT=$CONTROL_TESTS_PORT --publish $CONTROL_TESTS_PORT:$CONTROL_TESTS_PORT" fi @@ -196,7 +200,7 @@ function main echo Building the \"$IMAGE_TAG\" image... docker build \ --tag vasl-templates:$IMAGE_TAG \ - $CONTROL_TESTS_PORT_BUILD \ + $BUILD_ARGS \ $BUILD_NETWORK \ . 2>&1 \ | sed -e 's/^/ /'