feat: allow setting DOCKER_BIN path for docker execution

This change allows operators to specify a DOCKER_BIN environment variable. This will specify a binary to run when executing docker, which is useful in cases where the 'docker' command being run must be modified in a way that would otherwise be invasive to Dokku, but minimalistic if done within a wrapper.
This commit is contained in:
Jose Diaz-Gonzalez
2019-05-29 00:08:02 -04:00
parent 0e03c82139
commit 785d9b4937
33 changed files with 155 additions and 106 deletions

View File

@@ -25,7 +25,9 @@ func main() {
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
image := common.GetDeployingAppImageName(appName, "", "")
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
purgeCacheCmd := common.NewShellCmd(strings.Join([]string{"docker run --rm", dokkuGlobalRunArgs,
purgeCacheCmd := common.NewShellCmd(strings.Join([]string{
common.DockerBin(),
"run --rm", dokkuGlobalRunArgs,
"-v", strings.Join([]string{cacheHostDir, ":/cache"}, ""), image,
`find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} ;`}, " "))
purgeCacheCmd.Execute()