Build docker busybox image locally

Change-Id: I521962daca113202b52221cb53d93c0cad8f2d6f
Closes-bug: #1633435
This commit is contained in:
Liping Mao 2016-11-20 21:18:04 +08:00
parent 9cab12a819
commit b7f8f23440
7 changed files with 15 additions and 5 deletions

View File

@ -0,0 +1,3 @@
FROM scratch
ADD busybox.tar.xz /
CMD ["sh"]

5
contrib/busybox/build_image.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
tar cv --files-from /dev/null | docker import - scratch
sudo docker build -t kuryr/busybox .

Binary file not shown.

View File

@ -155,6 +155,11 @@ if is_service_enabled kuryr-libnetwork; then
done
echo ""
sudo chown "$STACK_USER":docker "$KURYR_DOCKER_ENGINE_SOCKET_FILE"
echo "Build busybox docker image for fullstack and rally test"
cd $DEST/kuryr-libnetwork/contrib/busybox
sudo usermod -aG docker $STACK_USER
sh build_image.sh
fi
if [[ "$1" == "stack" && "$2" == "extra" ]]; then

View File

@ -22,7 +22,6 @@ class ContainerTest(kuryr_base.KuryrBaseTest):
"""
def setUp(self):
super(ContainerTest, self).setUp()
self.docker_client.pull(repository='busybox', tag='1')
fake_ipam = {
"Driver": "kuryr",
@ -62,7 +61,7 @@ class ContainerTest(kuryr_base.KuryrBaseTest):
# Test if support connect/disconnect operations
container_name = lib_utils.get_random_string(8)
container = self.docker_client.create_container(
image='busybox:1',
image='kuryr/busybox',
command='/bin/sleep 600',
hostname='kuryr_test_container',
name=container_name)

View File

@ -53,8 +53,6 @@ class DockerNetworkContext(context.Context):
"""Create kuryr or non-kuryr docker network, and prepare image cache"""
try:
docker_client = docker.Client(base_url="tcp://0.0.0.0:2375")
# Cache busybox image
docker_client.pull(repository="busybox", tag="1")
if self.config["is_kuryr"]:
ipam = {

View File

@ -80,7 +80,7 @@ class KuryrScenario(scenario.OpenStackScenario):
def _start_container(self, container_create_args=None):
"""Start Container on docker network."""
container = self.docker_client.create_container(
image='busybox:1',
image='kuryr/busybox',
command='/bin/sleep 600')
container_id = container.get('Id')
self.docker_client.start(container=container_id)