fix: inject alternate label when building from an image

This label is otherwise missing, causing tooling that might want to know about it's pre-existing labels - specifically, docker-image-labeler - to fail to run as expected.
This commit is contained in:
Jose Diaz-Gonzalez
2021-03-25 22:14:53 -04:00
parent 9de027167d
commit 8660d58eb0
2 changed files with 3 additions and 2 deletions

View File

@@ -167,7 +167,8 @@ cmd-git-from-image() {
dokku_log_verbose "Setting Dockerfile"
touch "$TMP_WORK_DIR/Dockerfile"
echo "FROM $DOCKER_IMAGE" >"$TMP_WORK_DIR/Dockerfile"
echo "FROM $DOCKER_IMAGE" >>"$TMP_WORK_DIR/Dockerfile"
echo "LABEL com.dokku.docker-image-labeler/alternate-tags=\"[\"linuxserver/foldingathome:7.5.1-ls1\"]\"" >>"$TMP_WORK_DIR/Dockerfile"
plugn trigger git-from-directory "$APP" "$TMP_WORK_DIR" "$USER_NAME" "$USER_EMAIL"
}

View File

@@ -123,7 +123,7 @@ EOF
echo "status: $status"
assert_success
run /bin/bash -c "docker image inspect dokku/$TEST_APP:latest | grep 'alternate-tags'"
run /bin/bash -c "docker image inspect dokku/$TEST_APP:latest --format '{{ index .Config.Labels \"com.dokku.docker-image-labeler/alternate-tags\" }}'"
echo "output: $output"
echo "status: $status"
assert_success