Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #64 build, pull and push of container images #80

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ 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
script:
before_script:
- dnf install -y docker make git gettext
- docker login -u gbraad -p $DOCKER_PASSWORD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get the user name from the environment variable e.g. $DOCKER_USER

script:
- make
- mv ./build ./public
artifacts:
Expand Down
21 changes: 12 additions & 9 deletions iso/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the +1 in ${BUILD_CONTAINER_IMAGES+1} . If anyone wants to build the images locally we can set export BUILD_CONTAINER_IMAGES=1, right?

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 .
Expand Down