From 10d6a4a86c0e109e9738f85b61576c041f171f8c Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Wed, 13 Sep 2017 10:20:10 +0800 Subject: [PATCH] Issue #64 build, pull and push of container images --- .gitlab-ci.yml | 4 ++++ iso/build.sh | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 753472b..b561b09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,13 @@ build: image: fedora:26 variables: DOCKER_HOST: "tcp://gbraad__dind-options:2375" + BUILD_CONTAINER_IMAGES: y + PUSH_CONTAINER_IMAGES: y REMOVE_CONTAINER_IMAGES: y services: - gbraad/dind-options:latest + before_script: + - docker login -u gbraad -p $DOCKER_PASSWORD script: - dnf install -y docker make git gettext - make diff --git a/iso/build.sh b/iso/build.sh index 1166e80..b29a2aa 100755 --- a/iso/build.sh +++ b/iso/build.sh @@ -31,22 +31,25 @@ docker run $DOCKER_RUN_OPTIONS jpetazzo/nsenter cat /nsenter > $tmpdir/nsenter & # do not remove nsenter, as this image is not big, and quite generally used # Get socat -docker build -t socat -f Dockerfile.socat . -docker run $DOCKER_RUN_OPTIONS socat cat socat > $tmpdir/socat +[ "${BUILD_CONTAINER_IMAGES+1}" ] && docker build -t minishift/b2d-socat -f Dockerfile.socat . +docker run $DOCKER_RUN_OPTIONS minishift/b2d-socat cat socat > $tmpdir/socat chmod +x $tmpdir/socat -[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi socat +[ "${PUSH_CONTAINER_IMAGES+1}" ] && docker push minishift/b2d-socat +[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi minishift/b2d-socat # Get ethtool -docker build -t ethtool -f Dockerfile.ethtool . -docker run $DOCKER_RUN_OPTIONS ethtool cat ethtool > $tmpdir/ethtool +[ "${BUILD_CONTAINER_IMAGES+1}" ] && docker build -t minishift/b2d-ethtool -f Dockerfile.ethtool . +docker run $DOCKER_RUN_OPTIONS minishift/b2d-ethtool cat ethtool > $tmpdir/ethtool chmod +x $tmpdir/ethtool -[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi ethtool +[ "${PUSH_CONTAINER_IMAGES+1}" ] && docker push minishift/b2d-ethtool +[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi minishift/b2d-ethtool # Get conntrack -docker build -t conntrack -f Dockerfile.conntrack . -docker run $DOCKER_RUN_OPTIONS conntrack cat conntrack > $tmpdir/conntrack +[ "${BUILD_CONTAINER_IMAGES+1}" ] && docker build -t minishift/b2d-conntrack -f Dockerfile.conntrack . +docker run $DOCKER_RUN_OPTIONS minishift/b2d-conntrack cat conntrack > $tmpdir/conntrack chmod +x $tmpdir/conntrack -[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi conntrack +[ "${PUSH_CONTAINER_IMAGES+1}" ] && docker push minishift/b2d-conntrack +[ "${REMOVE_CONTAINER_IMAGES+1}" ] && docker rmi minishift/b2d-conntrack # Do the build. docker build -t b2diso .