From 664a970fc6bd3963c85b26cb83eed57aa6179978 Mon Sep 17 00:00:00 2001 From: dhurley Date: Mon, 26 Jun 2023 16:25:16 +0100 Subject: [PATCH 1/5] Add amazon linux 2023 support --- .github/workflows/ci.yml | 2 ++ Makefile | 2 +- Makefile.packaging | 7 ++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5614eb417c..d74de7afbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,8 @@ jobs: version: "9" - image: "amazonlinux" version: "2" + - image: "amazonlinux" + version: "2023" - image: "oraclelinux" version: "7" - image: "oraclelinux" diff --git a/Makefile b/Makefile index 8d83c686f3..dad754cc67 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ DATE = $(shell date +%F_%H-%M-%S) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | OS_RELEASE | OS_VERSION | NOTES | # | ---------------- | ----------------------------- | -------------------------------------------------------------- | -# | amazonlinux | 2 | | +# | amazonlinux | 2, 2023 | | # | ubuntu | 18.04, 20.04, 22.04 | | # | debian | bullseye-slim, buster-slim | | # | centos | 7 | | diff --git a/Makefile.packaging b/Makefile.packaging index 6d049cfffd..6377377a9f 100644 --- a/Makefile.packaging +++ b/Makefile.packaging @@ -21,7 +21,7 @@ APK_VERSIONS?=3.13 3.14 3.15 3.16 3.17 APK_ARCHS?=aarch64 x86_64 ALMA_VERSIONS?=almalinux-8 almalinux-9 ALMA_ARCHS?=aarch64 x86_64 -AMAZON_VERSIONS?=amazon-2 +AMAZON_VERSIONS?=amazon-2 amazon-2023 AMAZON_ARCHS?=aarch64 x86_64 UPLOAD_URL := "https://up-ap.nginx.com/" @@ -136,10 +136,7 @@ package: gpg-key $(PACKAGES_DIR) $(GITHUB_PACKAGES_DIR) $(AZURE_PACKAGES_DIR) ## goarch=amd64; \ if [ "$$arch" = "aarch64" ]; then goarch="arm64"; fi; \ GOWORK=off CGO_ENABLED=0 GOARCH=$${goarch} GOOS=linux go build -ldflags=${LDFLAGS} -o ./build/nginx-agent; \ - for distro in $(AMAZON_VERSIONS); do \ - rpm_distro=`echo $$distro | cut -d- -f 1`; \ - rpm_major=`echo $$distro | cut -d- -f 2`; \ - rpm_codename="amazon$$rpm_major"; \ + for rpm_codename in $(AMAZON_VERSIONS); do \ VERSION=$(shell echo ${VERSION} | tr -d 'v') ARCH=$${arch} nfpm pkg --config .nfpm.yaml --packager rpm --target $(PACKAGES_DIR)/rpm/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm; \ cp $(PACKAGES_DIR)/rpm/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm ${GITHUB_PACKAGES_DIR}/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm; \ cp $(PACKAGES_DIR)/rpm/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm ${AZURE_PACKAGES_DIR}/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v').$${rpm_codename}.ngx.$${arch}.rpm; \ From 9bf2dd2d94b837aa414635ca673b0422ac4d4866 Mon Sep 17 00:00:00 2001 From: dhurley Date: Mon, 26 Jun 2023 17:09:06 +0100 Subject: [PATCH 2/5] Update dockerfile --- Makefile | 2 ++ scripts/docker/nginx-oss/rpm/Dockerfile | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index dad754cc67..0fa121ee30 100644 --- a/Makefile +++ b/Makefile @@ -266,6 +266,8 @@ oss-image: ## Build agent container image for NGINX OSS --no-cache -f ./scripts/docker/nginx-oss/${CONTAINER_OS_TYPE}/Dockerfile \ --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ --build-arg BASE_IMAGE=${BASE_IMAGE} \ + --build-arg OS_RELEASE=${OS_RELEASE} \ + --build-arg OS_VERSION=${OS_VERSION} \ --build-arg ENTRY_POINT=./scripts/docker/entrypoint.sh run-container: ## Run container from specified IMAGE_TAG diff --git a/scripts/docker/nginx-oss/rpm/Dockerfile b/scripts/docker/nginx-oss/rpm/Dockerfile index aaa73490aa..38b8c4a9c1 100644 --- a/scripts/docker/nginx-oss/rpm/Dockerfile +++ b/scripts/docker/nginx-oss/rpm/Dockerfile @@ -2,7 +2,6 @@ ARG BASE_IMAGE FROM ${BASE_IMAGE} as install-nginx LABEL maintainer="NGINX Agent Maintainers " -ARG NGINX_CONF ARG ENTRY_POINT ARG OS_VERSION ARG OS_RELEASE @@ -15,10 +14,8 @@ RUN if [ "$OS_VERSION" = "7" ] && [ "$OS_RELEASE" = "oraclelinux" ]; \ then yum install -y oracle-epel-release-el7; \ fi - RUN if [ "$OS_RELEASE" = "amazonlinux" ]; \ - then amazon-linux-extras enable epel && yum clean metadata \ - && yum install -y epel-release shadow-utils; \ + then yum install -y shadow-utils; \ fi RUN set -x \ From 02cc81d9801fa1bce0df7d8c3a99d79febfce0f6 Mon Sep 17 00:00:00 2001 From: dhurley Date: Tue, 27 Jun 2023 09:22:25 +0100 Subject: [PATCH 3/5] Update dockerfile --- scripts/docker/nginx-oss/rpm/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/docker/nginx-oss/rpm/Dockerfile b/scripts/docker/nginx-oss/rpm/Dockerfile index 38b8c4a9c1..b3378d4439 100644 --- a/scripts/docker/nginx-oss/rpm/Dockerfile +++ b/scripts/docker/nginx-oss/rpm/Dockerfile @@ -14,6 +14,11 @@ RUN if [ "$OS_VERSION" = "7" ] && [ "$OS_RELEASE" = "oraclelinux" ]; \ then yum install -y oracle-epel-release-el7; \ fi +RUN if [ "$OS_VERSION" = "2" ] && [ "$OS_RELEASE" = "amazonlinux" ]; \ + then amazon-linux-extras enable epel && yum clean metadata \ + && yum install -y epel-release; \ + fi + RUN if [ "$OS_RELEASE" = "amazonlinux" ]; \ then yum install -y shadow-utils; \ fi From 9ba5275d25a40d4a2db6e4bd36aeeb428d660c2d Mon Sep 17 00:00:00 2001 From: dhurley Date: Tue, 27 Jun 2023 11:19:35 +0100 Subject: [PATCH 4/5] Update tech spec docs --- hugo/content/technical-specifications.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hugo/content/technical-specifications.md b/hugo/content/technical-specifications.md index 15a8661001..1dfddf61fe 100644 --- a/hugo/content/technical-specifications.md +++ b/hugo/content/technical-specifications.md @@ -25,6 +25,9 @@ Alpine Linux - 3.16 (x86_64, aarch64) - 3.17 (x86_64, aarch64) +Amazon Linux +- 2023 (x86_64, aarch64) + Amazon Linux 2 - LTS (x86_64, aarch64) From 33d83440866bed3fdbbdaa1c6e9051f36f9b7c69 Mon Sep 17 00:00:00 2001 From: dhurley Date: Fri, 30 Jun 2023 09:50:29 +0100 Subject: [PATCH 5/5] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f68d98ad74..0fdc1ed23b 100644 --- a/Makefile +++ b/Makefile @@ -268,7 +268,7 @@ oss-image: ## Build agent container image for NGINX OSS @echo Building image with $(CONTAINER_CLITOOL); \ $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t ${IMAGE_TAG} . \ --no-cache -f ./scripts/docker/nginx-oss/${CONTAINER_OS_TYPE}/Dockerfile \ - --target install-agent-repo \ + --target install-agent-local \ --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ --build-arg PACKAGES_REPO=${OSS_PACKAGES_REPO} \ --build-arg BASE_IMAGE=${BASE_IMAGE} \