mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #4841 from dokku/pack-in-docker
Ensure pack is run as root user when building apps in docker
This commit is contained in:
@@ -1 +1 @@
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler
|
||||
dokku ALL=NOPASSWD:SETENV:/usr/bin/docker,/usr/bin/docker-image-labeler,/usr/bin/pack
|
||||
|
||||
20
docker/usr/local/bin/pack
Executable file
20
docker/usr/local/bin/pack
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
[[ $TRACE ]] && set -x
|
||||
|
||||
main() {
|
||||
declare desc="re-runs pack commands as sudo"
|
||||
local PACK_BIN=""
|
||||
if [[ -x "/usr/bin/pack" ]]; then
|
||||
PACK_BIN="/usr/bin/pack"
|
||||
fi
|
||||
|
||||
if [[ -z "$PACK_BIN" ]]; then
|
||||
echo "! No pack binary found" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo -E "$PACK_BIN" "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user