-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #283 from sjberman/rhel-base
RHEL base image for OpenShift
- Loading branch information
Showing
11 changed files
with
188 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env groovy | ||
|
||
pipeline { | ||
agent { | ||
label "rhel7" | ||
} | ||
stages { | ||
stage("build") { | ||
steps { | ||
sh '''#!/usr/bin/env bash | ||
export BASE_OS=rhel7 | ||
export GIT_COMMIT=$(git rev-parse HEAD) | ||
export GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
DOCKER_NAMESPACE="docker-registry.pdbld.f5net.com/velcro" | ||
BASE_PUSH_TARGET="$DOCKER_NAMESPACE/k8s-bigip-ctlr" | ||
export IMG_TAG="${BASE_PUSH_TARGET}:${GIT_COMMIT}-$BASE_OS" | ||
export BUILD_IMG_TAG="${BASE_PUSH_TARGET}-devel:${GIT_COMMIT}-$BASE_OS" | ||
export CLEAN_BUILD=true | ||
build-tools/build-devel-image.sh | ||
build-tools/run-in-docker.sh make verify | ||
build-tools/build-debug-artifacts.sh | ||
build-tools/build-release-artifacts.sh | ||
build-tools/build-release-images.sh | ||
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:devel-$GIT_BRANCH-$BASE_OS" | ||
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:devel-$GIT_BRANCH-n-$BUILD_NUMBER-id-$BUILD_ID-$BASE_OS" | ||
docker push "$IMG_TAG" | ||
docker push "$BASE_PUSH_TARGET:devel-$GIT_BRANCH-$BASE_OS" | ||
docker push "$BASE_PUSH_TARGET:devel-$GIT_BRANCH-n-$BUILD_NUMBER-id-$BUILD_ID-$BASE_OS" | ||
''' | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
// cleanup workspace | ||
dir("${env.WORKSPACE}") { deleteDir() } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FROM registry.access.redhat.com/rhel7 | ||
|
||
# GOLANG install steps | ||
|
||
ENV GOLANG_VERSION 1.7.5 | ||
ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz | ||
ENV GOLANG_SRC_SHA256 4e834513a2079f8cbbd357502cccaac9507fd00a1efe672375798858ff291815 | ||
|
||
RUN REPOLIST=rhel-7-server-rpms,rhel-7-server-optional-rpms,rhel-server-rhscl-7-rpms && \ | ||
yum -y update-minimal --disablerepo "*" --enablerepo rhel-7-server-rpms --setopt=tsflags=nodocs \ | ||
--security --sec-severity=Important --sec-severity=Critical && \ | ||
yum -y install --disablerepo "*" --enablerepo ${REPOLIST} --setopt=tsflags=nodocs \ | ||
gcc openssl golang git make wget python27 && \ | ||
# Add epel repo for dpkg install | ||
curl -o epel-release-latest-7.noarch.rpm -SL https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ | ||
--retry 9 --retry-max-time 0 -C - && \ | ||
rpm -ivh epel-release-latest-7.noarch.rpm && rm epel-release-latest-7.noarch.rpm && \ | ||
yum -y install --disablerepo "*" --enablerepo epel --setopt=tsflags=nodocs dpkg && \ | ||
export GOROOT_BOOTSTRAP="$(go env GOROOT)" && \ | ||
wget -q "$GOLANG_SRC_URL" -O golang.tar.gz && \ | ||
echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c - && \ | ||
tar -C /usr/local -xzf golang.tar.gz && \ | ||
rm golang.tar.gz && \ | ||
cd /usr/local/go/src && \ | ||
./make.bash && \ | ||
yum -y erase golang && \ | ||
yum clean all | ||
|
||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" | ||
WORKDIR $GOPATH | ||
|
||
# install gosu | ||
# https://github.com/tianon/gosu/blob/master/INSTALL.md#from-centos | ||
ENV GOSU_VERSION 1.10 | ||
RUN set -ex && \ | ||
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" && \ | ||
wget -O /usr/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" && \ | ||
wget -O /tmp/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" && \ | ||
# verify the signature | ||
export GNUPGHOME="$(mktemp -d)" && \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \ | ||
gpg --batch --verify /tmp/gosu.asc /usr/bin/gosu && \ | ||
rm -r "$GNUPGHOME" /tmp/gosu.asc && \ | ||
chmod +x /usr/bin/gosu && \ | ||
# verify that the binary works | ||
gosu nobody true | ||
|
||
# Controller install steps | ||
COPY entrypoint.builder.sh /entrypoint.sh | ||
COPY k8s-build-requirements.txt /tmp/k8s-build-requirements.txt | ||
COPY k8s-runtime-requirements.txt /tmp/k8s-runtime-requirements.txt | ||
COPY requirements.docs.txt /tmp/requirements.docs.txt | ||
|
||
RUN source scl_source enable python27 && \ | ||
pip install --no-cache-dir --upgrade pip && \ | ||
pip install --no-cache-dir setuptools flake8 && \ | ||
pip install --no-cache-dir -r /tmp/k8s-build-requirements.txt && \ | ||
pip install --no-cache-dir -r /tmp/k8s-runtime-requirements.txt && \ | ||
pip install --no-cache-dir -r /tmp/requirements.docs.txt && \ | ||
go get github.com/wadey/gocovmerge && \ | ||
go get golang.org/x/tools/cmd/cover && \ | ||
go get github.com/mattn/goveralls && \ | ||
chmod 755 /entrypoint.sh | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD [ "/bin/bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM registry.access.redhat.com/rhel-atomic | ||
|
||
LABEL name="f5networks/k8s-bigip-ctlr" \ | ||
vendor="F5 Networks" \ | ||
# version - should be passed in via docker build | ||
url="http://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest/" \ | ||
summary="F5 BIG-IP Controller for Kubernetes" \ | ||
run='docker run --name ${NAME} ${IMAGE} /app/bin/k8s-bigip-ctlr' \ | ||
io.k8s.description="Manages F5 BIG-IP from Kubernetes" \ | ||
io.k8s.display-name="F5 BIG-IP Controller for Kubernetes" \ | ||
io.openshift.expose-services="" \ | ||
io.openshift.tags="f5,f5networks,bigip,openshift,router" | ||
|
||
ENV APPPATH /app | ||
|
||
RUN mkdir -p "$APPPATH/bin" \ | ||
&& chmod -R 755 "$APPPATH" | ||
|
||
WORKDIR $APPPATH | ||
|
||
COPY k8s-runtime-requirements.txt /tmp/k8s-runtime-requirements.txt | ||
|
||
RUN microdnf --enablerepo=rhel-7-server-rpms --enablerepo=rhel-7-server-optional-rpms \ | ||
--enablerepo=rhel-server-rhscl-7-rpms install --nodocs python27-python-pip git && \ | ||
source scl_source enable python27 && \ | ||
pip install --no-cache-dir --upgrade pip && \ | ||
pip install --no-cache-dir -r /tmp/k8s-runtime-requirements.txt && \ | ||
python -m pip uninstall -y pip setuptools && \ | ||
microdnf remove git fipscheck fipscheck-lib groff-base \ | ||
less libedit libgnome-keyring openssh openssh-clients perl perl-Carp perl-Encode \ | ||
perl-Error perl-Exporter perl-File-Path perl-File-Temp perl-Filter perl-Getopt-Long \ | ||
perl-Git perl-HTTP-Tiny perl-PathTools perl-Pod-Escapes perl-Pod-Perldoc perl-Pod-Simple \ | ||
perl-Pod-Usage perl-Scalar-List-Utils perl-Socket perl-Storable perl-TermReadKey \ | ||
perl-Text-ParseWords perl-Time-HiRes perl-Time-Local perl-constant perl-libs perl-macros \ | ||
perl-parent perl-podlators perl-threads perl-threads-shared rsync && \ | ||
microdnf clean all | ||
|
||
COPY bigip-virtual-server_v*.json $APPPATH/vendor/src/f5/schemas/ | ||
COPY python/ $APPPATH/python | ||
COPY k8s-bigip-ctlr $APPPATH/bin/k8s-bigip-ctlr.real | ||
|
||
# entrypoint to enable scl python at runtime | ||
RUN echo $'#!/bin/sh\n\ | ||
source scl_source enable python27\n\ | ||
exec $APPPATH/bin/k8s-bigip-ctlr.real "$@"' > $APPPATH/bin/k8s-bigip-ctlr && \ | ||
chmod +x $APPPATH/bin/k8s-bigip-ctlr | ||
|
||
# Run the run application in the projects bin directory. | ||
CMD [ "/app/bin/k8s-bigip-ctlr" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters