feat: allow passing labels to one-off dokku containers
This feature is allows users to add extra label metadata to one-off containers. As this can interfere with Dokku internals if they shadow labels used by plugins, care should be taken to avoid the `com.dokku` or `org.label-schema` namespace. Also proper name run containers so they don't get random names from docker...
This commit is contained in:
@@ -111,12 +111,17 @@ assert_urls() {
|
||||
@test "(core) run (detached)" {
|
||||
deploy_app
|
||||
|
||||
RANDOM_RUN_CID="$(dokku --detach run $TEST_APP sleep 300)"
|
||||
RANDOM_RUN_CID="$(dokku --label=com.dokku.test-label=value --detach run $TEST_APP sleep 300)"
|
||||
run /bin/bash -c "docker inspect -f '{{ .State.Status }}' $RANDOM_RUN_CID"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "running"
|
||||
|
||||
run /bin/bash -c "docker inspect $RANDOM_RUN_CID --format '{{ index .Config.Labels \"com.dokku.test-label\" }}'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "value"
|
||||
|
||||
run /bin/bash -c "docker stop $RANDOM_RUN_CID"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
|
||||
Reference in New Issue
Block a user