Files
docker-docs/test/integration/api/build.bats
Victor Costan e32b3211ae Swarm filters support in image building.
When building an image (POST /build), swarm will extract filters from
buildargs. This is similar to how container creation (POST
/containers/create) extracts filters from environment variables.

Signed-off-by: Victor Costan <costan@gmail.com>
2015-10-23 14:24:42 -04:00

36 lines
639 B
Bash

#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
@test "docker build" {
start_docker 2
swarm_manage
run docker_swarm images -q
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 0 ]
docker_swarm build -t test $TESTDATA/build
run docker_swarm images -q
[ "$status" -eq 0 ]
[ "${#lines[@]}" -eq 1 ]
}
@test "docker build with arg" {
start_docker_with_busybox 2
swarm_manage
run docker_swarm build -t test_args --build-arg="greeting=Hello Args" $TESTDATA/build_with_args
[ "$status" -eq 0 ]
run docker_swarm run --rm test_args
[ "$status" -eq 0 ]
[[ "$output" == "Hello Args" ]]
}