Images for use with OpenStack Helm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 2017 The Openstack-Helm Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ifndef IMAGE_NAME
  15. $(error The TAG variable is missing.)
  16. endif
  17. ifndef OS_RELEASE
  18. $(error The ENV variable is missing.)
  19. endif
  20. SHELL := /bin/bash
  21. DOCKER_REGISTRY ?= docker.io
  22. IMAGE_PREFIX ?= openstackhelm
  23. IMAGE_TAG ?= latest
  24. CALICOCTL_VERSION ?= v3.4.4
  25. # Set the image
  26. # eg: quay.io/att-comdev/ceph-config-helper:latest
  27. IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
  28. ifeq ($(IMAGE_NAME), calicoctl-utility)
  29. IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${CALICOCTL_VERSION}-${IMAGE_TAG}
  30. endif
  31. # Build Docker image for this project
  32. .PHONY: images
  33. images: build_$(IMAGE_NAME)
  34. # Make targets intended for use by the primary targets above.
  35. .PHONY: build_$(IMAGE_NAME)
  36. build_$(IMAGE_NAME):
  37. ifeq ($(OS_RELEASE), ubuntu_xenial)
  38. docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
  39. --network host \
  40. $(EXTRA_BUILD_ARGS) \
  41. -t $(IMAGE) \
  42. .
  43. else ifeq ($(OS_RELEASE), suse_15)
  44. docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
  45. --network host \
  46. $(EXTRA_BUILD_ARGS) \
  47. -t $(IMAGE) \
  48. .
  49. else ifeq ($(OS_RELEASE), debian)
  50. docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
  51. --network host \
  52. $(EXTRA_BUILD_ARGS) \
  53. -t $(IMAGE) \
  54. .
  55. else ifeq ($(OS_RELEASE), centos_7)
  56. docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
  57. --network host \
  58. $(EXTRA_BUILD_ARGS) \
  59. -t $(IMAGE) \
  60. .
  61. else ifeq ($(OS_RELEASE), alpine)
  62. docker build -f $(IMAGE_NAME)/Dockerfile.$(OS_RELEASE) \
  63. --network host \
  64. --build-arg CALICOCTL_VERSION=${CALICOCTL_VERSION} \
  65. $(EXTRA_BUILD_ARGS) \
  66. -t $(IMAGE) \
  67. .
  68. else
  69. docker build -t $(IMAGE) --network=host $(EXTRA_BUILD_ARGS) -f $(IMAGE_NAME)/Dockerfile.simple \
  70. .
  71. endif