From dc752322905f5d443a6d1e7d184ef824724aac30 Mon Sep 17 00:00:00 2001 From: Matthew Heler Date: Fri, 4 Jan 2019 14:27:06 -0600 Subject: [PATCH] Add Ceph Daemon image with Mimic support - Add a new dockerfile to create a Ceph docker image Change-Id: Id5bdb959ac57cca75ece62457cb233a5b99e5bd0 --- ceph-daemon/Dockerfile.ubuntu_xenial | 73 ++++++++++++++++++++++++++++ ceph-daemon/build.sh | 14 ++++++ 2 files changed, 87 insertions(+) create mode 100644 ceph-daemon/Dockerfile.ubuntu_xenial create mode 100755 ceph-daemon/build.sh diff --git a/ceph-daemon/Dockerfile.ubuntu_xenial b/ceph-daemon/Dockerfile.ubuntu_xenial new file mode 100644 index 00000000..63a37340 --- /dev/null +++ b/ceph-daemon/Dockerfile.ubuntu_xenial @@ -0,0 +1,73 @@ +FROM docker.io/ubuntu:xenial +MAINTAINER matthew.heler@hotmail.com + +ARG KUBE_VERSION=1.12.2 +ARG CEPH_RELEASE=mimic +ARG ETCDCTL_VERSION=3.2.18 +ARG CONFD_VERSION=0.16.0 + +ADD https://download.ceph.com/keys/release.asc /etc/apt/ceph-release.asc +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-key add /etc/apt/ceph-release.asc ;\ + rm -f /etc/apt/ceph-release.asc ;\ + echo "deb http://download.ceph.com/debian-${CEPH_RELEASE}/ xenial main" | tee /etc/apt/sources.list.d/ceph.list ;\ + TMP_DIR=$(mktemp --directory) ;\ + cd ${TMP_DIR} ;\ + apt-get update ;\ + apt-get dist-upgrade -y ;\ + apt-get install --no-install-recommends -y \ + apt-transport-https \ + ca-certificates \ + ceph \ + ceph-common \ + radosgw \ + ceph-mds \ + ceph-fuse \ + rbd-nbd \ + rbd-mirror \ + rbd-fuse \ + s3cmd \ + strace \ + valgrind \ + hexedit \ + sysstat \ + dstat \ + smartmontools \ + sdparm \ + tcpdump \ + iperf \ + xfsprogs \ + rsync \ + curl \ + gcc \ + gdb \ + python \ + python-dev \ + uuid-runtime \ + jq ;\ + curl -sSL https://bootstrap.pypa.io/get-pip.py | python ;\ + pip --no-cache-dir install --upgrade \ + six \ + python-openstackclient \ + python-swiftclient ;\ + curl -sSL https://dl.k8s.io/v${KUBE_VERSION}/kubernetes-client-linux-amd64.tar.gz | tar -zxv --strip-components=1 ;\ + mv ${TMP_DIR}/client/bin/kubectl /usr/local/bin/kubectl ;\ + chmod +x /usr/local/bin/kubectl ;\ + curl -sSL https://bin.equinox.io/c/ekMN3bCZFUn/forego-stable-linux-amd64.tgz | tar xfz - -C /usr/local/bin/ ;\ + chmod +x /usr/local/bin/forego ;\ + curl -sSL https://github.com/coreos/etcd/releases/download/v${ETCDCTL_VERSION}/etcd-v${ETCDCTL_VERSION}-linux-amd64.tar.gz | tar xfz - ;\ + mv ${TMP_DIR}/etcd-v${ETCDCTL_VERSION}-linux-amd64/etcdctl /usr/local/bin/etcdctl ;\ + chmod +xr /usr/local/bin/etcdctl ;\ + curl -sSL https://github.com/kelseyhightower/confd/releases/download/v${CONFD_VERSION}/confd-${CONFD_VERSION}-linux-amd64 -o /usr/local/bin/confd ;\ + chmod +xr /usr/local/bin/confd ;\ + mkdir -p /etc/confd/conf.d ;\ + mkdir -p /etc/confd/templates ;\ + rm -rf ${TMP_DIR} ;\ + apt-get purge -y --auto-remove \ + python-dev \ + gcc ;\ + rm -rf /var/lib/apt/lists/* ;\ + rm -rf /usr/share/doc/ ;\ + rm -rf /usr/share/man/ ;\ + rm -rf /usr/share/locale/ diff --git a/ceph-daemon/build.sh b/ceph-daemon/build.sh new file mode 100755 index 00000000..ef542b45 --- /dev/null +++ b/ceph-daemon/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="ceph-daemon" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-ubuntu_xenial} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd -