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

build in container #20

Merged
merged 6 commits into from Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion Dockerfile.build
@@ -1,6 +1,13 @@
FROM registry.mv.nuagenetworks.net:5000/build/golang:1.9

RUN yum install -y rpm-build &&\
RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &&\
yum install -y rpm-build \
yum-utils \
device-mapper-persistent-data \
lvm2 \
docker-ce \
sudo &&\
yum groupinstall -y "Development Tools" &&\
mkdir -p /BUILD/go/src/github.com/nuagenetworks/nuage-libnetwork

WORKDIR /BUILD/go/src/github.com/nuagenetworks/nuage-libnetwork
6 changes: 5 additions & 1 deletion docker_build_script.sh 100644 → 100755
Expand Up @@ -6,6 +6,9 @@ USER_ID=$(id -u)
GROUP_ID=$(id -g)
DOCKERFILE="Dockerfile.build"
PWD=$(pwd)

MAKE_TARGET=${1}

docker run --privileged \
--rm \
-e NUAGE_PROJECT=${NUAGE_PROJECT} \
Expand All @@ -18,5 +21,6 @@ docker run --privileged \
-v ${PWD}:/BUILD/go/src/github.com/nuagenetworks/nuage-libnetwork \
-v /usr/global:/usr/global \
-v /root:/root \
-v /var/run/docker.sock:/var/run/docker.sock \
registry.mv.nuagenetworks.net:5000/build/nuage-libnetwork \
sh scripts/buildRPM.sh
make ${MAKE_TARGET}
13 changes: 13 additions & 0 deletions makefile
@@ -0,0 +1,13 @@
all: build_docker_image run_container
build_all: build_nuage_libnetwork

build_docker_image:
docker build -t registry.mv.nuagenetworks.net:5000/build/nuage-libnetwork -f Dockerfile.build .

run_container:
./docker_build_script.sh build_all

build_nuage_libnetwork:
./scripts/buildRPM.sh
./scripts/create-docker-image.sh
yes | ./scripts/create-v2-plugin.sh registry.mv.nuagenetworks.net:5000/nuage-plugin:latest
2 changes: 1 addition & 1 deletion scripts/create-docker-image.sh
Expand Up @@ -12,7 +12,7 @@ if [ -z ${version} ]; then
exit 1
fi

#go build
go build

docker build -t nuage-plugin:${version} -f Dockerfile .

Expand Down