From b93e479cf0ca026bcc12fa2af0a98968d7910b79 Mon Sep 17 00:00:00 2001 From: Carl Wilson Date: Fri, 22 Nov 2019 00:31:55 +0000 Subject: [PATCH 1/5] FIX - grab user id and default group. --- docker-package-win.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-package-win.sh b/docker-package-win.sh index e4a0840..0c07865 100755 --- a/docker-package-win.sh +++ b/docker-package-win.sh @@ -32,7 +32,7 @@ function buildAndPackage(){ # https://docs.docker.com/engine/reference/run/#volume-shared-filesystems docker run -v "$(pwd):/src/" --name temp-container "cdrx/pyinstaller-windows:${1}" docker commit temp-container temp-image - docker run -v "$(pwd):/src/" --rm temp-image "chown 1000 -R /src/dist" + docker run -v "$(pwd):/src/" --rm temp-image "chown $(id -u):$(id -g) -R /src/dist" docker container rm temp-container docker image rm temp-image # Zip up the package and clean up From 403a8971e3f487301ca4cefc54709e89b9882bc9 Mon Sep 17 00:00:00 2001 From: Carl Wilson Date: Fri, 22 Nov 2019 00:36:37 +0000 Subject: [PATCH 2/5] FEAT - no fail docker cleanup. --- docker-package-win.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-package-win.sh b/docker-package-win.sh index 0c07865..5c451dd 100755 --- a/docker-package-win.sh +++ b/docker-package-win.sh @@ -30,6 +30,8 @@ function buildAndPackage(){ # https://docs.docker.com/engine/reference/run/#clean-up---rm # -v "$(pwd):/src/" Map working directory to container /src: # https://docs.docker.com/engine/reference/run/#volume-shared-filesystems + docker stop temp-container || true && docker rm temp-container || true + docker image rm temp-image || true docker run -v "$(pwd):/src/" --name temp-container "cdrx/pyinstaller-windows:${1}" docker commit temp-container temp-image docker run -v "$(pwd):/src/" --rm temp-image "chown $(id -u):$(id -g) -R /src/dist" From 701f7fec06a1356850f89de1dd5da160ac8b5e06 Mon Sep 17 00:00:00 2001 From: Carl Wilson Date: Fri, 22 Nov 2019 01:18:35 +0000 Subject: [PATCH 3/5] FIX - single liner for permissions. --- docker-package-win.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docker-package-win.sh b/docker-package-win.sh index 5c451dd..d204f42 100755 --- a/docker-package-win.sh +++ b/docker-package-win.sh @@ -30,13 +30,8 @@ function buildAndPackage(){ # https://docs.docker.com/engine/reference/run/#clean-up---rm # -v "$(pwd):/src/" Map working directory to container /src: # https://docs.docker.com/engine/reference/run/#volume-shared-filesystems - docker stop temp-container || true && docker rm temp-container || true - docker image rm temp-image || true - docker run -v "$(pwd):/src/" --name temp-container "cdrx/pyinstaller-windows:${1}" - docker commit temp-container temp-image - docker run -v "$(pwd):/src/" --rm temp-image "chown $(id -u):$(id -g) -R /src/dist" - docker container rm temp-container - docker image rm temp-image + docker run -v "$(pwd):/src/" --rm "cdrx/pyinstaller-windows:${1}" "/entrypoint.sh && chown $(id -u):$(id -g) -R /src/dist" + # Zip up the package and clean up cd "${WIN_DIST_DIR}" zip -r ${zip_name} ${pkgname} From b14b4a7c05cf9fde5bdcf436fcf8cf5be08e6c7b Mon Sep 17 00:00:00 2001 From: Carl Wilson Date: Fri, 22 Nov 2019 04:31:20 +0000 Subject: [PATCH 4/5] FIX - use param. --- docker-package-win.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-package-win.sh b/docker-package-win.sh index d204f42..21d78bf 100755 --- a/docker-package-win.sh +++ b/docker-package-win.sh @@ -30,7 +30,7 @@ function buildAndPackage(){ # https://docs.docker.com/engine/reference/run/#clean-up---rm # -v "$(pwd):/src/" Map working directory to container /src: # https://docs.docker.com/engine/reference/run/#volume-shared-filesystems - docker run -v "$(pwd):/src/" --rm "cdrx/pyinstaller-windows:${1}" "/entrypoint.sh && chown $(id -u):$(id -g) -R /src/dist" + docker run -v "$(pwd):/src/" --user "$(id -u)":"$(id -g)" --rm "cdrx/pyinstaller-windows:${1}" # Zip up the package and clean up cd "${WIN_DIST_DIR}" From 10ce60cd9c787eafb5341e4d216b11724b46f515 Mon Sep 17 00:00:00 2001 From: Carl Wilson Date: Fri, 22 Nov 2019 12:35:12 +0000 Subject: [PATCH 5/5] FIX - reverted change. --- docker-package-win.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-package-win.sh b/docker-package-win.sh index 21d78bf..d204f42 100755 --- a/docker-package-win.sh +++ b/docker-package-win.sh @@ -30,7 +30,7 @@ function buildAndPackage(){ # https://docs.docker.com/engine/reference/run/#clean-up---rm # -v "$(pwd):/src/" Map working directory to container /src: # https://docs.docker.com/engine/reference/run/#volume-shared-filesystems - docker run -v "$(pwd):/src/" --user "$(id -u)":"$(id -g)" --rm "cdrx/pyinstaller-windows:${1}" + docker run -v "$(pwd):/src/" --rm "cdrx/pyinstaller-windows:${1}" "/entrypoint.sh && chown $(id -u):$(id -g) -R /src/dist" # Zip up the package and clean up cd "${WIN_DIST_DIR}"