refactor: add global docker build and run args
This reduces duplication and allows users to rely on global arguments to generate most labels needed. The 'commit' command cannot have global arguments because the whitespace within the label change breaks string-based interpolation, and shell arrays cannot be exported.
This commit is contained in:
@@ -21,7 +21,7 @@ func PurgeCache(appName string) error {
|
||||
dokkuGlobalRunArgs := common.MustGetEnv("DOKKU_GLOBAL_RUN_ARGS")
|
||||
image := config.GetWithDefault(appName, "DOKKU_IMAGE", os.Getenv("DOKKU_IMAGE"))
|
||||
if info, _ := os.Stat(cacheDir); info != nil && info.IsDir() {
|
||||
dockerLabelArgs := fmt.Sprintf("--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=com.dokku.app-name=%s", appName)
|
||||
dockerLabelArgs := fmt.Sprintf("--label=com.dokku.app-name=%s", appName)
|
||||
purgeCacheCmd := common.NewShellCmd(strings.Join([]string{
|
||||
common.DockerBin(),
|
||||
"run --rm", dockerLabelArgs, dokkuGlobalRunArgs,
|
||||
|
||||
Reference in New Issue
Block a user