Merge pull request #615 from travisn/client-container-build

Build the toolbox and client containers
This commit is contained in:
Travis Nielsen
2017-04-27 16:42:59 -07:00
committed by GitHub
6 changed files with 56 additions and 67 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ For a walkthrough of the three types of storage exposed by Rook, see the guides
### Rook Client
You also have the option to use the `rook` client tool directly by running it in a pod that can be started in the cluster with:
```bash
kubectl create -f rook-client/rook-client.yml
kubectl create -f rook-client.yml
# Starting the rook-client pod will take a bit of time to download the container, so check when it's in the Running state
kubectl -n rook get pod rook-client
+53 -2
View File
@@ -33,8 +33,13 @@ build_artifact() {
local name=$(get_image_name $os $arch $repo ${RELEASE_VERSION})
local docker_no_cache=
if [[ ${RELEASE_CHANNEL} != "" ]]; then
docker_no_cache=--no-cache
fi
echo building docker container ${name}
docker build --pull --no-cache -t ${registry}${name} $tmpdir
docker build --pull ${docker_no_cache} -t ${registry}${name} $tmpdir
local file=${name/\//-}
local file=${file/:/-}
@@ -59,6 +64,7 @@ build() {
arm64) baseimage=aarch64/alpine ;;
esac
echo "Building the rookd container"
tmpdir=$(mktemp -d)
trap "rm -fr $tmpdir" EXIT
cat <<EOF > $tmpdir/Dockerfile
@@ -69,6 +75,50 @@ ENTRYPOINT ["/usr/bin/rookd"]
EOF
build_artifact $os $arch $tmpdir rook/rookd rookd
rm -fr $tmpdir
# TODO: build the client and toolbox for arm
[[ ${arch} == "amd64" ]] || return 0
echo "Building the rook-client container"
mkdir $tmpdir
cat <<EOF > $tmpdir/Dockerfile
FROM ubuntu
RUN apt-get update && \
apt-get install -yq --no-install-recommends wget s3cmd kmod module-init-tools sudo
COPY root /
ENTRYPOINT ["/usr/bin/rook"]
EOF
build_artifact $os $arch $tmpdir rook/rook-client rook
rm -fr $tmpdir
echo "Building the toolbox container"
mkdir $tmpdir
cp toolbox/entrypoint.sh $tmpdir
cat <<EOF > $tmpdir/Dockerfile
FROM ubuntu:xenial
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 08b73419ac32b4e966c1a330e84ac2c0460f3994 \
&& echo "deb http://download.ceph.com/debian-${CEPH_BRANCH}/ xenial main" > /etc/apt/sources.list.d/ceph-${CEPH_BRANCH}.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
binutils \
ceph-common \
curl \
fio \
gdb \
iperf3 \
jq \
kmod \
less \
man-db \
sudo \
vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY root /
COPY entrypoint.sh /toolbox/
ENTRYPOINT [ "/toolbox/entrypoint.sh" ]
EOF
build_artifact $os $arch $tmpdir rook/toolbox rook
rm -fr $tmpdir
}
publish_artifact() {
@@ -148,8 +198,9 @@ cleanup() {
local arch=$2
[[ ${os} == "linux" ]] || return 0
cleanup_artifact $os $arch rook/rookd
cleanup_artifact $os $arch rook/rook-client
cleanup_artifact $os $arch rook/toolbox
}
action=$1
@@ -6,7 +6,7 @@ metadata:
spec:
containers:
- name: rook-client
image: quay.io/rook/rook-client:latest
image: quay.io/rook/rook-client:master-latest
imagePullPolicy: IfNotPresent
command: ["sleep", "36500d"]
securityContext:
-16
View File
@@ -1,16 +0,0 @@
FROM ubuntu
MAINTAINER Jared Watts <jared.watts@quantum.com>
ENV ROOK_VERSION 0.3.1
RUN apt-get update && \
apt-get install -yq --no-install-recommends wget s3cmd kmod module-init-tools sudo
RUN wget --no-check-certificate -P /tmp https://github.com/rook/rook/releases/download/v${ROOK_VERSION}/rook-v${ROOK_VERSION}-linux-amd64.tar.gz && \
gunzip /tmp/rook-v${ROOK_VERSION}-linux-amd64.tar.gz && \
tar -xf /tmp/rook-v${ROOK_VERSION}-linux-amd64.tar -C /tmp && \
mv /tmp/rook /usr/local/bin/ && \
chmod 0755 /usr/local/bin/rook && \
rm -rf /tmp/rook*
-46
View File
@@ -1,46 +0,0 @@
# Copyright 2016 The Rook Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:xenial
MAINTAINER Jared Watts <jared.watts@quantum.com>
# install common tools for debugging and testing (including ceph Kraken)
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 08b73419ac32b4e966c1a330e84ac2c0460f3994 \
&& echo "deb http://download.ceph.com/debian-kraken/ xenial main" > /etc/apt/sources.list.d/ceph-kraken.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
binutils \
ceph-common \
curl \
fio \
gdb \
iperf3 \
jq \
kmod \
less \
man-db \
sudo \
vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV ROOK_VERSION v0.3.1
RUN cd /tmp && \
curl -s -L https://github.com/rook/rook/releases/download/${ROOK_VERSION}/rook-${ROOK_VERSION}-linux-amd64.tar.gz > rook.tar.gz && \
tar xvf rook.tar.gz && \
mv rook /usr/bin/ && \
chown root:root /usr/bin/rook && \
rm -fr rook*
COPY entrypoint.sh /toolbox/
ENTRYPOINT [ "/toolbox/entrypoint.sh" ]
+1 -1
View File
@@ -6,7 +6,7 @@ metadata:
spec:
containers:
- name: rook-tools
image: quay.io/rook/toolbox:latest
image: quay.io/rook/toolbox:master-latest
imagePullPolicy: IfNotPresent
args: ["sleep", "36500d"]
env: