Makefile and Docker file for calicoctl-utility containers
Change-Id: Ia3442e3b5b89bf27e30c1f524dca8e63c4e3cea9
This commit is contained in:
parent
4aa86c67cb
commit
0908d43c58
18
Makefile
18
Makefile
@ -24,11 +24,16 @@ SHELL := /bin/bash
|
||||
DOCKER_REGISTRY ?= docker.io
|
||||
IMAGE_PREFIX ?= openstackhelm
|
||||
IMAGE_TAG ?= latest
|
||||
CALICOCTL_VERSION ?= v3.4.4
|
||||
|
||||
# Set the image
|
||||
# eg: quay.io/att-comdev/ceph-config-helper:latest
|
||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||
|
||||
ifeq ($(IMAGE_NAME), calicoctl-utility)
|
||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${CALICOCTL_VERSION}-${IMAGE_TAG}
|
||||
endif
|
||||
|
||||
# Build Docker image for this project
|
||||
.PHONY: images
|
||||
images: build_$(IMAGE_NAME)
|
||||
@ -50,16 +55,23 @@ else ifeq ($(OS_RELEASE), suse_15)
|
||||
.
|
||||
else ifeq ($(OS_RELEASE), debian)
|
||||
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
|
||||
--network host \
|
||||
--network host \
|
||||
$(EXTRA_BUILD_ARGS) \
|
||||
-t $(IMAGE) \
|
||||
.
|
||||
-t $(IMAGE) \
|
||||
.
|
||||
else ifeq ($(OS_RELEASE), centos_7)
|
||||
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
|
||||
--network host \
|
||||
$(EXTRA_BUILD_ARGS) \
|
||||
-t $(IMAGE) \
|
||||
.
|
||||
else ifeq ($(OS_RELEASE), alpine)
|
||||
docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
|
||||
--network host \
|
||||
--build-arg CALICOCTL_VERSION=${CALICOCTL_VERSION} \
|
||||
$(EXTRA_BUILD_ARGS) \
|
||||
-t $(IMAGE) \
|
||||
.
|
||||
else
|
||||
docker build -t $(IMAGE) --network=host $(EXTRA_BUILD_ARGS) -f $(IMAGE_NAME)/Dockerfile.simple \
|
||||
.
|
||||
|
@ -1,5 +1,5 @@
|
||||
Makefile For Ceph images
|
||||
------------------------
|
||||
Makefile For Ceph and Calicoctl images
|
||||
--------------------------------------
|
||||
|
||||
This is a make and dockerfile for containers. This can be used to create docker images using different releases and os releases
|
||||
|
||||
@ -12,3 +12,6 @@ eg:
|
||||
|
||||
make IMAGE_NAME=openvswitch OS_RELEASE=debian
|
||||
|
||||
make IMAGE_NAME=calicoctl-utility OS_RELEASE=alpine
|
||||
|
||||
Note: calicoctl-utlity image only supports alpine OS.
|
||||
|
30
calicoctl-utility/Dockerfile.alpine
Normal file
30
calicoctl-utility/Dockerfile.alpine
Normal file
@ -0,0 +1,30 @@
|
||||
ARG CALICOCTL_VERSION=v3.4.4
|
||||
ARG FROM=quay.io/calico/ctl:${CALICOCTL_VERSION}
|
||||
FROM ${FROM}
|
||||
|
||||
LABEL org.opencontainers.image.authors='Openstack-Helm Authors'
|
||||
LABEL org.opencontainers.image.url='https://git.openstack.com/openstack/openstack-helm-images'
|
||||
LABEL org.opencontainers.image.documentation='https://git.openstack.com/openstack/openstack-helm-images/blob/master/README_MAKEFILE'
|
||||
LABEL org.opencontainers.image.source='https://git.openstack.com/openstack/openstack-helm-images'
|
||||
LABEL org.opencontainers.image.vendor='Openstack-Helm Authors'
|
||||
LABEL org.opencontainers.image.licenses='BSD-3-Clause'
|
||||
LABEL calicoctl.version='${CALICOCTL_VERSION}'
|
||||
|
||||
RUN set -xe \
|
||||
&& export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apk add dpkg --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
|
||||
&& apk add --update dpkg \
|
||||
&& touch /var/lib/dpkg/status \
|
||||
&& apk update \
|
||||
&& apk add --update \
|
||||
python python-dev py-pip build-base \
|
||||
sudo vim screen rsyslog \
|
||||
wget curl socat \
|
||||
&& pip install oslo.rootwrap
|
||||
|
||||
RUN mv /calicoctl /usr/local/bin/calicoctl \
|
||||
&& chmod 0754 /usr/local/bin/calicoctl \
|
||||
&& chmod 0754 /usr/bin/socat
|
||||
|
||||
WORKDIR /tmp
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
20
calicoctl-utility/build.sh
Executable file
20
calicoctl-utility/build.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
SCRIPT=`realpath $0`
|
||||
SCRIPT_DIR=`dirname ${SCRIPT}`
|
||||
## Only build from main folder
|
||||
cd ${SCRIPT_DIR}/..
|
||||
|
||||
IMAGE="calicoctl-utility"
|
||||
VERSION=${VERSION:-v3.4.4}
|
||||
DISTRO=${DISTRO:-alpine}
|
||||
REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"}
|
||||
EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""}
|
||||
|
||||
docker build -f ${IMAGE}/Dockerfile.${DISTRO} \
|
||||
--network=host \
|
||||
--build-arg CALICOCTL_VERSION=${VERSION} \
|
||||
-t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} \
|
||||
${extra_build_args} \
|
||||
${IMAGE}
|
||||
|
||||
cd -
|
21
doc/source/calicoctl-utility.rst
Normal file
21
doc/source/calicoctl-utility.rst
Normal file
@ -0,0 +1,21 @@
|
||||
=================================
|
||||
calicoctl-utility container image
|
||||
=================================
|
||||
|
||||
This container builds a small image with calicoctl-utility service and
|
||||
some other utilities for use bt the operator.
|
||||
|
||||
Manual build
|
||||
============
|
||||
|
||||
Here are the instructions for building the image:
|
||||
|
||||
.. literalinclude:: ../../calicoctl-utility/build.sh
|
||||
:lines: 7-19
|
||||
:language: shell
|
||||
|
||||
Alternatively, this step can be performed by running the script directly:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./calicoctl-utility/build.sh
|
57
zuul.d/calicoctl-utility.yaml
Normal file
57
zuul.d/calicoctl-utility.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
---
|
||||
# Copyright 2019, AT&T Corporation.
|
||||
#
|
||||
# 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-build-calicoctl-utility
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-helm-images-upload-calicoctl-utility
|
||||
promote:
|
||||
jobs:
|
||||
- openstack-helm-images-promote-calicoctl-utility
|
||||
periodic:
|
||||
jobs:
|
||||
- openstack-helm-images-build-calicoctl-utility
|
||||
|
||||
- job:
|
||||
name: openstack-helm-images-build-calicoctl-utility
|
||||
parent: openstack-helm-images-build
|
||||
description: Build calicoctl-utility images
|
||||
vars: &calicoctl-utility_vars
|
||||
docker_images:
|
||||
- context: calicoctl-utility
|
||||
repository: openstackhelm/calicoctl-utility
|
||||
dockerfile: Dockerfile.alpine
|
||||
tags:
|
||||
- latest-alpine
|
||||
files: &calicoctl-utility_files
|
||||
- calicoctl-utility/.*
|
||||
- zuul.d/calicoctl-utility.yaml
|
||||
|
||||
- job:
|
||||
name: openstack-helm-images-upload-calicoctl-utility
|
||||
parent: openstack-helm-images-upload
|
||||
description: Build and upload calicoctl-utility images
|
||||
vars: *calicoctl-utility_vars
|
||||
files: *calicoctl-utility_files
|
||||
|
||||
- job:
|
||||
name: openstack-helm-images-promote-calicoctl-utility
|
||||
parent: openstack-helm-images-promote
|
||||
description: Promote a previously published calicoctl-utility image to latest.
|
||||
vars: *calicoctl-utility_vars
|
||||
files: *calicoctl-utility_files
|
Loading…
x
Reference in New Issue
Block a user