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:
@@ -5,9 +5,11 @@ load test_helper
|
||||
setup() {
|
||||
global_setup
|
||||
deploy_app
|
||||
rm -f /tmp/fake-docker-bin
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -f /tmp/fake-docker-bin
|
||||
destroy_app
|
||||
global_teardown
|
||||
}
|
||||
@@ -46,3 +48,33 @@ teardown() {
|
||||
|
||||
dokku --force apps:destroy "${TEST_APP}-2"
|
||||
}
|
||||
|
||||
@test "(report) custom docker bin" {
|
||||
export DOCKER_BIN="docker"
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "herokuish version:"
|
||||
assert_success
|
||||
|
||||
export DOCKER_BIN="/usr/bin/docker"
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "herokuish version:"
|
||||
assert_success
|
||||
|
||||
touch /tmp/fake-docker-bin
|
||||
echo '#!/usr/bin/env bash' >/tmp/fake-docker-bin
|
||||
echo '/usr/bin/docker "$@"' >>/tmp/fake-docker-bin
|
||||
chmod +x /tmp/fake-docker-bin
|
||||
|
||||
export DOCKER_BIN="/tmp/fake-docker-bin"
|
||||
run /bin/bash -c "dokku report"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "herokuish version:"
|
||||
assert_success
|
||||
|
||||
unset DOCKER_BIN
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user