refactor: simplify file ownership in the container by setting the process ownership during the build process

Rather than require a heavy chown operation across various paths, just chown the files already in the built image during the release process. This ensures we can skip not-only the chown process during the container start that herokuish injects, but also the one that Dokku runs which modifies mounted container paths as well during the pre-deploy.

Note that users will need to ensure any mounted volumes don't have permissions reset by other processes or containers won't be able to access them.
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-25 14:42:19 -05:00
parent 0d6bde2eff
commit 68d05b230d
12 changed files with 20 additions and 83 deletions

View File

@@ -194,10 +194,6 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku scheduler-docker-local:set $TEST_APP disable-chown true"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:rename $TEST_APP great-test-name"
echo "output: $output"
@@ -228,11 +224,6 @@ teardown() {
echo "status: $status"
assert_success
assert_output "100"
run /bin/bash -c "dokku scheduler-docker-local:report great-test-name --scheduler-docker-local-disable-chown"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "true"
run /bin/bash -c "dokku --force apps:destroy great-test-name"
echo "output: $output"

View File

@@ -59,10 +59,6 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku scheduler-docker-local:set $TEST_APP disable-chown true"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:clone $TEST_APP great-test-name"
echo "output: $output"
@@ -103,11 +99,6 @@ teardown() {
echo "status: $status"
assert_success
assert_output "100"
run /bin/bash -c "dokku scheduler-docker-local:report great-test-name --scheduler-docker-local-disable-chown"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "true"
run /bin/bash -c "dokku --force apps:destroy great-test-name"
echo "output: $output"