diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0924677d --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. +ifndef IMAGE_NAME +$(error The TAG variable is missing.) +endif + +ifndef OS_RELEASE +$(error The ENV variable is missing.) +endif + +SHELL := /bin/bash + +DOCKER_REGISTRY ?= quay.io +IMAGE_PREFIX ?= att-comdev +IMAGE_TAG ?= latest + +# Set the image +# eg: quay.io/att-comdev/ceph-config-helper:latest +IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} + +# Build Docker image for this project +.PHONY: images +images: build_$(IMAGE_NAME) + +# Make targets intended for use by the primary targets above. +.PHONY: build_$(IMAGE_NAME) +build_$(IMAGE_NAME): +ifeq ($(OS_RELEASE), ubuntu_xenial) + docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \ + --network host \ + -t $(IMAGE) \ + . +else ifeq ($(OS_RELEASE), suse_15) + docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \ + --network host \ + -t $(IMAGE) \ + . +else ifeq ($(OS_RELEASE), debian) + docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \ + --network host \ + -t $(IMAGE) \ + . +else ifeq ($(OS_RELEASE), centos_7) + docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \ + --network host \ + -t $(IMAGE) \ + . +else + docker build -t $(IMAGE) --network=host -f $(IMAGE_NAME)/Dockerfile.simple \ + . +endif diff --git a/README_MAKEFILE b/README_MAKEFILE new file mode 100644 index 00000000..15b791b3 --- /dev/null +++ b/README_MAKEFILE @@ -0,0 +1,14 @@ +Makefile For Ceph images +------------------------ + +This is a make and dockerfile for containers. This can be used to create docker images using different releases and os releases + +Usage: + + make IMAGE_NAME=<> OS_RELEASE=<> +eg: + + make IMAGE_NAME=ceph-daemon OS_RELEASE=ubuntu_xenial + + make IMAGE_NAME=openvswitch OS_RELEASE=debian + diff --git a/ceph-config-helper/Dockerfile.suse_15 b/ceph-config-helper/Dockerfile.suse_15 index b8e7fe24..f567f2a3 100644 --- a/ceph-config-helper/Dockerfile.suse_15 +++ b/ceph-config-helper/Dockerfile.suse_15 @@ -3,11 +3,12 @@ FROM ${FROM} LABEL maintainers=stephane@alum.mit.edu ARG KUBE_VERSION=v1.10.3 -ARG CEPH_RELEASE=luminous +ARG CEPH_RELEASE=mimic RUN set -ex ;\ TMP_DIR=$(mktemp --directory) ;\ cd ${TMP_DIR} ;\ - zypper refresh ;\ + zypper ar https://download.opensuse.org/repositories/filesystems:/ceph:/${CEPH_RELEASE}/openSUSE_Leap_15.0/ ${CEPH_RELEASE} ;\ + zypper --gpg-auto-import-keys refresh ;\ zypper up -y ;\ zypper install -y \ ca-certificates-cacert \ diff --git a/ceph-config-helper/Dockerfile.ubuntu_xenial b/ceph-config-helper/Dockerfile.ubuntu_xenial index 53c0c949..c88a5454 100644 --- a/ceph-config-helper/Dockerfile.ubuntu_xenial +++ b/ceph-config-helper/Dockerfile.ubuntu_xenial @@ -1,8 +1,8 @@ -FROM docker.io/ubuntu:xenial -LABEL maintainer="pete.birley@att.com" +ARG FROM=docker.io/ubuntu:xenial +FROM ${FROM} ARG KUBE_VERSION=v1.10.3 -ARG CEPH_RELEASE=luminous +ARG CEPH_RELEASE=mimic ADD https://download.ceph.com/keys/release.asc /etc/apt/ceph-release.asc RUN set -ex ;\ diff --git a/ceph-daemon/Dockerfile.ubuntu_xenial b/ceph-daemon/Dockerfile.ubuntu_xenial index 63a37340..bff6cabf 100644 --- a/ceph-daemon/Dockerfile.ubuntu_xenial +++ b/ceph-daemon/Dockerfile.ubuntu_xenial @@ -1,4 +1,5 @@ -FROM docker.io/ubuntu:xenial +ARG FROM=docker.io/ubuntu:xenial +FROM ${FROM} MAINTAINER matthew.heler@hotmail.com ARG KUBE_VERSION=1.12.2 diff --git a/ceph-utility/Dockerfile.ubuntu_xenial b/ceph-utility/Dockerfile.ubuntu_xenial new file mode 100644 index 00000000..08481be3 --- /dev/null +++ b/ceph-utility/Dockerfile.ubuntu_xenial @@ -0,0 +1,17 @@ +ARG FROM=docker.io/ubuntu:xenial +FROM ${FROM} + +ARG CEPH_RELEASE=mimic + +RUN set -xe \ + && sed -i '/nobody/d' /etc/passwd \ + && echo "nobody:x:65534:65534:nobody:/nonexistent:/bin/bash" >> /etc/passwd \ + && apt-get update && apt-get install -y wget curl apt-transport-https gnupg\ + && wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add - \ + && echo deb https://download.ceph.com/debian-${CEPH_RELEASE}/ xenial main | tee /etc/apt/sources.list.d/ceph.list \ + && apt-get update && apt-get install -y bash python-oslo.rootwrap moreutils vim sudo screen ceph-common python-rbd radosgw rsyslog x11-apps jq \ + && apt-get remove --purge -y wget apt-transport-https && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* \ + && curl -sSL https://bootstrap.pypa.io/get-pip.py | python \ + && pip --no-cache-dir install --upgrade rgwadmin crush + +CMD ["/bin/bash"] diff --git a/ceph-utility/build.sh b/ceph-utility/build.sh new file mode 100755 index 00000000..5fab85cf --- /dev/null +++ b/ceph-utility/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-utility" +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 - diff --git a/libvirt/Dockerfile.ubuntu_xenial b/libvirt/Dockerfile.ubuntu_xenial index 02295cdd..0284028c 100644 --- a/libvirt/Dockerfile.ubuntu_xenial +++ b/libvirt/Dockerfile.ubuntu_xenial @@ -2,7 +2,7 @@ FROM docker.io/ubuntu:xenial LABEL maintainer="pete.birley@att.com" ARG LIBVIRT_VERSION="1.3.1-1ubuntu10.24" -ARG CEPH_RELEASE=luminous +ARG CEPH_RELEASE=mimic ARG PROJECT=nova ARG UID=42424 ARG GID=42424 diff --git a/zuul.d/ceph-utility.yaml b/zuul.d/ceph-utility.yaml new file mode 100644 index 00000000..6b76b528 --- /dev/null +++ b/zuul.d/ceph-utility.yaml @@ -0,0 +1,41 @@ +--- +# 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. + +- project: + check: + jobs: + - openstack-helm-images-ceph-utility-ubuntu_xenial: + files: &ceph-ubuntuxenial-files + - ^ceph-utility/build.sh + - ^ceph-utility/Dockerfile.ubuntu_xenial$ + - ^zuul.d/ceph-utility.yaml + gate: + jobs: + - openstack-helm-images-ceph-utility-ubuntu_xenial: + files: *ceph-ubuntuxenial-files + periodic: + jobs: + - openstack-helm-images-ceph-utility-ubuntu_xenial + +- job: + name: openstack-helm-images-ceph-utility + parent: openstack-helm-images-base + abstract: true + vars: + image_path: ceph-utility + +- job: + name: openstack-helm-images-ceph-utility-ubuntu_xenial + parent: openstack-helm-images-ceph-utility + vars: + distro: "ubuntu_xenial"