From abab1e88077b869753029c2caf17d2210199c262 Mon Sep 17 00:00:00 2001 From: Abhishek Choudhary Date: Fri, 13 Oct 2023 09:00:20 +0545 Subject: [PATCH] chore: remove centos based docker images (#512) --- ...apisix-docker-example-test-standalone.yaml | 1 - .../workflows/apisix-docker-example-test.yaml | 1 - .github/workflows/apisix_push_docker_hub.yaml | 1 - .../workflows/dashboard_push_docker_hub.yaml | 5 -- Makefile | 68 ------------------ centos/Dockerfile | 45 ------------ centos/docker-entrypoint.sh | 61 ---------------- dashboard/Dockerfile.centos | 71 ------------------- docs/en/latest/build.md | 4 +- 9 files changed, 2 insertions(+), 255 deletions(-) delete mode 100644 centos/Dockerfile delete mode 100755 centos/docker-entrypoint.sh delete mode 100644 dashboard/Dockerfile.centos diff --git a/.github/workflows/apisix-docker-example-test-standalone.yaml b/.github/workflows/apisix-docker-example-test-standalone.yaml index c34d80f8..e40db30c 100644 --- a/.github/workflows/apisix-docker-example-test-standalone.yaml +++ b/.github/workflows/apisix-docker-example-test-standalone.yaml @@ -41,7 +41,6 @@ jobs: fail-fast: false matrix: platform: - - centos - debian - redhat diff --git a/.github/workflows/apisix-docker-example-test.yaml b/.github/workflows/apisix-docker-example-test.yaml index 495b0d1e..7fc7a5c6 100644 --- a/.github/workflows/apisix-docker-example-test.yaml +++ b/.github/workflows/apisix-docker-example-test.yaml @@ -41,7 +41,6 @@ jobs: fail-fast: false matrix: platform: - - centos - debian - redhat diff --git a/.github/workflows/apisix_push_docker_hub.yaml b/.github/workflows/apisix_push_docker_hub.yaml index 91a80131..55a8623f 100644 --- a/.github/workflows/apisix_push_docker_hub.yaml +++ b/.github/workflows/apisix_push_docker_hub.yaml @@ -10,7 +10,6 @@ jobs: fail-fast: false matrix: platform: - - centos - debian - redhat env: diff --git a/.github/workflows/dashboard_push_docker_hub.yaml b/.github/workflows/dashboard_push_docker_hub.yaml index 1110668c..e1b92964 100644 --- a/.github/workflows/dashboard_push_docker_hub.yaml +++ b/.github/workflows/dashboard_push_docker_hub.yaml @@ -8,7 +8,6 @@ jobs: fail-fast: false matrix: os: - - centos - alpine name: build dashboard & test on ${{ matrix.os }} && push to docker hub @@ -55,7 +54,3 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Push apisix dashboard image to Docker Hub - if: matrix.os == 'centos' - run: | - make push-multiarch-dashboard diff --git a/Makefile b/Makefile index f63be469..ad85c8d3 100644 --- a/Makefile +++ b/Makefile @@ -61,14 +61,6 @@ define func_echo_success_status endef -# Makefile target -### build-on-centos : Build apache/apisix:xx-centos image -.PHONY: build-on-centos -build-on-centos: - @$(call func_echo_status, "$@ -> [ Start ]") - $(ENV_DOCKER) build -t $(ENV_APISIX_IMAGE_TAG_NAME)-centos -f ./centos/Dockerfile centos - @$(call func_echo_success_status, "$@ -> [ Done ]") - ### build-on-redhat : Build apache/apisix:xx-redhat image .PHONY: build-on-redhat build-on-redhat: @@ -114,16 +106,6 @@ push-multiarch-on-debian: @$(call func_echo_success_status, "$@ -> [ Done ]") -### push-multiarch-on-centos : Push apache/apisix:xx-centos image -.PHONY: push-multiarch-on-centos -push-multiarch-on-centos: - @$(call func_echo_status, "$@ -> [ Start ]") - $(ENV_DOCKER) buildx build --network=host --push \ - -t $(ENV_APISIX_IMAGE_TAG_NAME)-centos \ - --platform linux/amd64,linux/arm64 \ - -f ./centos/Dockerfile centos - @$(call func_echo_success_status, "$@ -> [ Done ]") - ### push-multiarch-on-redhat : Push apache/apisix:xx-redhat image .PHONY: push-multiarch-on-redhat push-multiarch-on-redhat: @@ -166,15 +148,6 @@ build-dashboard-all-in-one: @$(call func_echo_success_status, "$@ -> [ Done ]") -### save-centos-tar : tar apache/apisix:xx-centos image -.PHONY: save-centos-tar -save-centos-tar: - @$(call func_echo_status, "$@ -> [ Start ]") - mkdir -p package - $(ENV_DOCKER) save -o ./package/$(ENV_APISIX_TAR_NAME)-centos.tar $(ENV_APISIX_IMAGE_TAG_NAME)-centos - @$(call func_echo_success_status, "$@ -> [ Done ]") - - ### save-debian-tar : tar apache/apisix:xx-debian image .PHONY: save-debian-tar save-debian-tar: @@ -184,16 +157,6 @@ save-debian-tar: @$(call func_echo_success_status, "$@ -> [ Done ]") -### build-dashboard-centos : Build apache/dashboard:tag image on centos -.PHONY: build-dashboard-centos -build-dashboard-centos: - @$(call func_echo_status, "$@ -> [ Start ]") - $(ENV_DOCKER) build -t $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION) \ - --build-arg APISIX_DASHBOARD_TAG=v$(APISIX_DASHBOARD_VERSION) \ - -f ./dashboard/Dockerfile.centos . - @$(call func_echo_success_status, "$@ -> [ Done ]") - - ### build-dashboard-alpine : Build apache/dashboard:tag image on alpine .PHONY: build-dashboard-alpine build-dashboard-alpine: @@ -204,37 +167,6 @@ build-dashboard-alpine: @$(call func_echo_success_status, "$@ -> [ Done ]") -### push-multiarch-dashboard : Build and push multiarch apache/dashboard:tag image -.PHONY: push-multiarch-dashboard -push-multiarch-dashboard: - @$(call func_echo_status, "$@ -> [ Start ]") - $(ENV_DOCKER) buildx build --push \ - -t $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)-alpine \ - --build-arg APISIX_DASHBOARD_TAG=v$(APISIX_DASHBOARD_VERSION) \ - --platform linux/amd64,linux/arm64 \ - -f ./dashboard/Dockerfile.alpine . - $(ENV_DOCKER) buildx build --push \ - -t $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION)-centos \ - --build-arg APISIX_DASHBOARD_TAG=v$(APISIX_DASHBOARD_VERSION) \ - --platform linux/amd64,linux/arm64 \ - -f ./dashboard/Dockerfile.centos . - $(ENV_DOCKER) buildx build --push \ - -t $(APISIX_DASHBOARD_IMAGE_NAME):latest \ - --build-arg APISIX_DASHBOARD_TAG=v$(APISIX_DASHBOARD_VERSION) \ - --platform linux/amd64,linux/arm64 \ - -f ./dashboard/Dockerfile.centos . - @$(call func_echo_success_status, "$@ -> [ Done ]") - - -### save-dashboard-centos-tar : tar apache/apisix-dashboard:tag image -.PHONY: save-dashboard-centos-tar -save-dashboard-centos-tar: - @$(call func_echo_status, "$@ -> [ Start ]") - mkdir -p package - $(ENV_DOCKER) save -o ./package/$(APISIX_DASHBOARD_IMAGE_TAR_NAME)_$(APISIX_DASHBOARD_VERSION)-centos.tar $(APISIX_DASHBOARD_IMAGE_NAME):$(APISIX_DASHBOARD_VERSION) - @$(call func_echo_success_status, "$@ -> [ Done ]") - - ### save-dashboard-alpine-tar : tar apache/apisix-dashboard:tag image .PHONY: save-dashboard-alpine-tar save-dashboard-alpine-tar: diff --git a/centos/Dockerfile b/centos/Dockerfile deleted file mode 100644 index dcc63129..00000000 --- a/centos/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -FROM centos:7 - -ARG APISIX_VERSION=3.6.0 -LABEL apisix_version="${APISIX_VERSION}" - -RUN yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm \ - && yum install -y apisix-${APISIX_VERSION} wget \ - && yum clean all \ - && sed -i 's/PASS_MAX_DAYS\t99999/PASS_MAX_DAYS\t60/g' /etc/login.defs - -WORKDIR /usr/local/apisix - -ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin - -# forward request and error logs to docker log collector -RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \ - && ln -sf /dev/stderr /usr/local/apisix/logs/error.log \ - && rm /usr/local/openresty/bin/etcdctl - -EXPOSE 9080 9443 - -COPY ./docker-entrypoint.sh /docker-entrypoint.sh - -ENTRYPOINT ["/docker-entrypoint.sh"] - -CMD ["docker-start"] - -STOPSIGNAL SIGQUIT diff --git a/centos/docker-entrypoint.sh b/centos/docker-entrypoint.sh deleted file mode 100755 index a8a34a9e..00000000 --- a/centos/docker-entrypoint.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -set -eo pipefail - -PREFIX=${APISIX_PREFIX:=/usr/local/apisix} - -if [[ "$1" == "docker-start" ]]; then - if [ "$APISIX_STAND_ALONE" = "true" ]; then - # If the file is not present then initialise the content otherwise update relevant keys for standalone mode - if [ ! -f "${PREFIX}/conf/config.yaml" ]; then - cat > ${PREFIX}/conf/config.yaml << _EOC_ -deployment: - role: data_plane - role_data_plane: - config_provider: yaml -_EOC_ - else - # updating config.yaml for standalone mode - sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml - sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml - fi - - if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then - cat > ${PREFIX}/conf/apisix.yaml << _EOC_ -routes: - - -#END -_EOC_ - fi - /usr/bin/apisix init - else - /usr/bin/apisix init - /usr/bin/apisix init_etcd - fi - - # For versions below 3.5.0 whose conf_server has not been removed. - if [ -e "/usr/local/apisix/conf/config_listen.sock" ]; then - rm -f "/usr/local/apisix/conf/config_listen.sock" - fi - - exec /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;' -fi - -exec "$@" diff --git a/dashboard/Dockerfile.centos b/dashboard/Dockerfile.centos deleted file mode 100644 index a3710ef2..00000000 --- a/dashboard/Dockerfile.centos +++ /dev/null @@ -1,71 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# -ARG BUILDPLATFORM=amd64 - -FROM --platform=$BUILDPLATFORM alpine:latest as pre-build - -ARG APISIX_DASHBOARD_TAG=v3.0.1 - -RUN set -x \ - && apk add --no-cache --virtual .builddeps git \ - && git clone https://github.com/apache/apisix-dashboard.git -b ${APISIX_DASHBOARD_TAG} /usr/local/apisix-dashboard \ - && cd /usr/local/apisix-dashboard && git clean -Xdf \ - && rm -f ./.githash && git log --pretty=format:"%h" -1 > ./.githash \ - && rm /usr/local/openresty/bin/etcdctl - -FROM --platform=$BUILDPLATFORM golang:1.19 as api-builder - -ARG ENABLE_PROXY=false - -WORKDIR /usr/local/apisix-dashboard - -COPY --from=pre-build /usr/local/apisix-dashboard . - -ARG TARGETOS -ARG TARGETARCH - -RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w GOPROXY=https://goproxy.io,direct ; fi \ - && go env -w GO111MODULE=on \ - && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} ./api/build.sh - -FROM --platform=$BUILDPLATFORM node:14-alpine as fe-builder - -ARG ENABLE_PROXY=false - -WORKDIR /usr/local/apisix-dashboard - -COPY --from=pre-build /usr/local/apisix-dashboard . - -WORKDIR /usr/local/apisix-dashboard/web - -RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config set registry https://registry.npm.taobao.org/ ; fi \ - && yarn install \ - && yarn build - -FROM centos:8 as prod - -WORKDIR /usr/local/apisix-dashboard - -COPY --from=api-builder /usr/local/apisix-dashboard/output/ ./ - -COPY --from=fe-builder /usr/local/apisix-dashboard/output/ ./ - -RUN mkdir logs - -EXPOSE 9000 - -ENTRYPOINT [ "/usr/local/apisix-dashboard/manager-api" ] diff --git a/docs/en/latest/build.md b/docs/en/latest/build.md index 41bd7b4c..2c8ca048 100644 --- a/docs/en/latest/build.md +++ b/docs/en/latest/build.md @@ -44,7 +44,7 @@ Build a Docker image from the release: ```shell APISIX_VERSION=3.6.0 # specify release version -DISTRO=debian # debian, centos, redhat +DISTRO=debian # debian, redhat make build-on-$DISTRO ``` @@ -56,7 +56,7 @@ Build a Docker image from the master branch: ```shell APISIX_VERSION=master # master branch -DISTRO=debian # debian, centos, redhat +DISTRO=debian # debian, redhat make build-on-$DISTRO ```