Implement 'bocker pull' for Docker Hub integration

This commit is contained in:
Peter Wilmott
2015-07-27 19:04:14 +01:00
parent d5b38393c2
commit b240a47ac8
5 changed files with 66 additions and 39 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
for img in $(./bocker images | grep 'img'); do
for img in $(./bocker images | grep 'img' | awk '{print $1}'); do
./bocker rm "$img"
done

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
[[ "$(./bocker images | head -n 1)" == 'IMAGE_ID' ]]
[[ "$(./bocker images | head -n 1)" == 'IMAGE_ID SOURCE' ]]

16
tests/test_pull Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
centos_img="$(./bocker pull centos 7 2> /dev/null | awk '{print $2}')"
./bocker run "$centos_img" cat /etc/redhat-release
ps="$(./bocker ps | grep 'cat /etc/redhat-release' | awk '{print $1}')"
logs="$(./bocker logs "$ps")"
./bocker rm "$ps"
[[ "$logs" == "CentOS Linux release 7"* ]]
ubuntu_img="$(./bocker pull ubuntu 14.04 2> /dev/null | awk '{print $2}')"
./bocker run "$ubuntu_img" tail -n1 /etc/lsb-release
ps="$(./bocker ps | grep 'tail -n1 /etc/lsb-release' | awk '{print $1}')"
logs="$(./bocker logs "$ps")"
./bocker rm "$ps"
[[ "$logs" == *"Ubuntu 14.04"* ]]