From f1ccf4002996300a2202f4c11cc6fb3c621e3f9a Mon Sep 17 00:00:00 2001
From: Matthew Defenderfer <mdefende@uab.edu>
Date: Fri, 25 Oct 2024 14:50:15 -0500
Subject: [PATCH] copy cookie from build context and use in container instead
 of needing to pass in username and password

---
 Dockerfile | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index ca46b1e..ee02364 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,6 @@
 FROM ubuntu:jammy
 
 ENV DEBIAN_FRONTEND=noninteractive
-ARG USERNAME
-ARG PASSWORD
 
 RUN apt-get update && \
     apt-get install -y \
@@ -29,11 +27,8 @@ RUN apt-get update && \
     libgomp1 \
     && rm -rf /var/lib/apt/lists
 
-RUN ENCODED_USERNAME=$(printf '%s' "$USERNAME" | jq -sRr @uri) && \
-    ENCODED_PASSWORD=$(printf '%s' "$PASSWORD" | jq -sRr @uri) && \
-    curl -c cookies.txt -X POST -d "log=${ENCODED_USERNAME}&pwd=${ENCODED_PASSWORD}&wp-submit=1" "https://febio.org/wp-login.php" -v && \
-    curl --output /tmp/febio.zip -b cookies.txt "https://febio.org/download/12171/?tmstv=1729879260" && \
-    unset USERNAME PASSWORD ENCODED_USERNAME ENCODED_PASSWORD
+COPY cookies.txt /tmp/cookies.txt
+RUN curl --output /tmp/febio.zip -b /tmp/cookies.txt "https://febio.org/download/12171/?tmstv=1729879260"
 
 RUN unzip /tmp/febio.zip && \
     chmod +x FEBioStudio_linux-x64_2.7_FEBio_4.7.run && \
-- 
GitLab