Makefile 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. default: help
  18. APISIX_VERSION ?= 2.9
  19. IMAGE_NAME = apache/apisix
  20. IMAGE_TAR_NAME = apache_apisix
  21. APISIX_DASHBOARD_VERSION ?= 2.7.1
  22. APISIX_DASHBOARD_IMAGE_NAME = apache/apisix-dashboard
  23. APISIX_DASHBOARD_IMAGE_TAR_NAME = apache_apisix_dashboard
  24. ### build-on-centos: Build apache/apisix:xx-centos image
  25. build-on-centos:
  26. docker build -t $(IMAGE_NAME):$(APISIX_VERSION)-centos -f ./centos/Dockerfile .
  27. ### build-on-alpine: Build apache/apisix:xx-alpine image
  28. build-on-alpine:
  29. docker build -t $(IMAGE_NAME):$(APISIX_VERSION)-alpine -f ./alpine/Dockerfile .
  30. ### build-on-alpine-local: Build apache/apisix:xx-alpine-local image
  31. # Actually it is not build on certain version but on local code
  32. # Use this name (in the same patterns with others) for convenient CI
  33. build-on-alpine-local:
  34. docker build -t $(IMAGE_NAME):$(APISIX_VERSION)-alpine-local --build-arg APISIX_PATH=${APISIX_PATH} -f ./alpine-local/Dockerfile .
  35. ### push-on-centos: Push apache/apisix:xx-centos image
  36. # centos not support multiarch since it reply on x86 rpm package
  37. push-on-centos:
  38. docker push $(IMAGE_NAME):$(APISIX_VERSION)-centos
  39. docker build -t $(IMAGE_NAME):latest -f ./centos/Dockerfile .
  40. docker push $(IMAGE_NAME):latest
  41. ### push-on-alpine: Push apache/apisix:xx-alpine image
  42. push-multiarch-on-alpine:
  43. docker buildx build --push \
  44. -t $(IMAGE_NAME):$(APISIX_VERSION)-alpine \
  45. --platform linux/amd64,linux/arm64 \
  46. -f ./alpine/Dockerfile .
  47. ### build-on-alpine-cn: Build apache/apisix:xx-alpine image (for chinese)
  48. build-on-alpine-cn:
  49. docker build -t $(IMAGE_NAME):${APISIX_VERSION}-alpine --build-arg APISIX_VERSION=${APISIX_VERSION} --build-arg ENABLE_PROXY=true -f alpine/Dockerfile alpine
  50. ### build-all-in-one: Build All in one Docker container for Apache APISIX
  51. build-all-in-one:
  52. docker build -t $(IMAGE_NAME):whole -f ./all-in-one/apisix/Dockerfile .
  53. ### save-centos-tar: tar apache/apisix:xx-centos image
  54. save-centos-tar:
  55. mkdir -p package
  56. docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-centos.tar $(IMAGE_NAME):$(APISIX_VERSION)-centos
  57. ### save-alpine-tar: tar apache/apisix:xx-alpine image
  58. save-alpine-tar:
  59. mkdir -p package
  60. docker save -o ./package/$(IMAGE_TAR_NAME)_$(APISIX_VERSION)-alpine.tar $(IMAGE_NAME):$(APISIX_VERSION)-alpine
  61. ### build-dashboard: Build apache/dashboard:tag image
  62. build-dashboard:
  63. docker build -t $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION) -f ./dashboard/Dockerfile .
  64. ### push-dashboard: Push apache/dashboard:tag image
  65. push-dashboard:
  66. docker push $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)
  67. docker build -t $(APISIX_DASHBOARD_IMAGE_NAME):latest -f ./dashboard/Dockerfile .
  68. docker push $(APISIX_DASHBOARD_IMAGE_NAME):latest
  69. ### save-dashboard-tar: tar apache/apisix-dashboard:tag image
  70. save-dashboard-tar:
  71. mkdir -p package
  72. docker save -o ./package/$(APISIX_DASHBOARD_IMAGE_TAR_NAME)_$(APISIX_DASHBOARD_VERSION).tar $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)
  73. ### help: Show Makefile rules
  74. help:
  75. @echo Makefile rules:
  76. @echo
  77. @grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'