diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ecde7efde..4f42b99a33 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 76d5014885..0fdc1ed23b 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 | | @@ -268,10 +268,12 @@ 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-local + --target install-agent-local \ --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ --build-arg PACKAGES_REPO=${OSS_PACKAGES_REPO} \ --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/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; \ 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) diff --git a/scripts/docker/nginx-oss/rpm/Dockerfile b/scripts/docker/nginx-oss/rpm/Dockerfile index 31153733a3..88290e38dc 100644 --- a/scripts/docker/nginx-oss/rpm/Dockerfile +++ b/scripts/docker/nginx-oss/rpm/Dockerfile @@ -3,7 +3,6 @@ FROM ${BASE_IMAGE} as install-nginx LABEL maintainer="NGINX Agent Maintainers " ARG PACKAGES_REPO -ARG NGINX_CONF ARG ENTRY_POINT ARG OS_VERSION ARG OS_RELEASE @@ -16,6 +15,15 @@ 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 + RUN if [ "$OS_RELEASE" = "centos" ] && [ "$OS_VERSION" = "7" ]; \ then yum install -y epel-release; \ fi @@ -28,10 +36,6 @@ gpgcheck=0 \n\ enabled=1" > /etc/yum.repos.d/nginx.repo; \ fi -RUN if [ "$OS_RELEASE" = "amazonlinux" ]; \ - then amazon-linux-extras enable epel && yum clean metadata \ - && yum install -y epel-release shadow-utils; \ - fi RUN set -x \ && groupadd --system --gid 101 nginx \ @@ -45,7 +49,15 @@ RUN set -x \ nginx # Setup nginx agent repository -RUN if [ "$OS_RELEASE" = "amazonlinux" ]; \ +RUN if [ "$OS_VERSION" = "2023" ] && [ "$OS_RELEASE" = "amazonlinux" ]; \ + then printf "[nginx-agent] \n\ +name=nginx-agent repo \n\ +baseurl=http://${PACKAGES_REPO}/nginx-agent/amzn/${OS_VERSION}/\$basearch \n\ +gpgcheck=1 \n\ +enabled=1 \n\ +gpgkey=https://nginx.org/keys/nginx_signing.key \n\ +module_hotfixes=true" > /etc/yum.repos.d/nginx-agent.repo; \ + elif [ "$OS_VERSION" = "2" ] && [ "$OS_RELEASE" = "amazonlinux" ]; \ then printf "[nginx-agent] \n\ name=nginx-agent repo \n\ baseurl=http://${PACKAGES_REPO}/nginx-agent/amzn2/${OS_VERSION}/\$basearch \n\