diff --git a/build-html-docker.sh b/build-html-docker.sh
index d733cf3..deef88a 100755
--- a/build-html-docker.sh
+++ b/build-html-docker.sh
@@ -2,11 +2,15 @@
cd /source
+userid="$(cat userid.info)"
+
# Script to build an HTML site from the PDF source
pdf2htmlEX --embed cfijo --dest-dir out DPSResume.pdf
-chown -R root:root out
-chmod -R 666 out
+chown -R $userid:$userid out/
+chmod -R 666 out/
+chmod u+x out/
-tar -czvf ResumeSite.tar.gz -C out .
-chmod 666 *.tar.gz
-#rm -rf out
+tar -czvf ResumeSite.tar.gz -C out/ .
+chown $userid:$userid ResumeSite.tar.gz
+chmod 666 ResumeSite.tar.gz
+rm -rf out
diff --git a/build-html.sh b/build-html.sh
index 2cae282..a00cb6e 100755
--- a/build-html.sh
+++ b/build-html.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+echo "$(id -u)" > userid.info
+
# Script to build an HTML site from the PDF source
-docker run -d -v $(pwd):/source sothr/pdf2htmlex /usr/bin/env bash /source/build-html-docker.sh
+docker run -v $(pwd):/source sothr/pdf2htmlex /usr/bin/env bash /source/build-html-docker.sh
+
+rm userid.info
diff --git a/build-pdf-docker.sh b/build-pdf-docker.sh
index 971eb5b..a66e3ef 100755
--- a/build-pdf-docker.sh
+++ b/build-pdf-docker.sh
@@ -2,7 +2,10 @@
cd /source
+userid="$(cat userid.info)"
+
# Script to build a PDF from the latex source
latex --output-format pdf DPSResume.tex
+chown $userid:$userid DPSResume.pdf
chmod 666 DPSResume.pdf
rm DPSResume.log
diff --git a/build-pdf.sh b/build-pdf.sh
index ec03d43..116765e 100755
--- a/build-pdf.sh
+++ b/build-pdf.sh
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
+echo "$(id -u)" > userid.info
+
# Script to build a PDF from the latex source
docker run -v $(pwd):/source schickling/latex /usr/bin/env bash /source/build-pdf-docker.sh
+
+rm userid.info