Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Amazon Linux 2023 support #355

Merged
merged 6 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
version: "9"
- image: "amazonlinux"
version: "2"
- image: "amazonlinux"
version: "2023"
- image: "oraclelinux"
version: "7"
- image: "oraclelinux"
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions Makefile.packaging
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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; \
Expand Down
3 changes: 3 additions & 0 deletions hugo/content/technical-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 5 additions & 3 deletions scripts/docker/nginx-oss/rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE} as install-nginx
LABEL maintainer="NGINX Agent Maintainers <[email protected]>"

ARG NGINX_CONF
ARG ENTRY_POINT
ARG OS_VERSION
ARG OS_RELEASE
Expand All @@ -15,10 +14,13 @@ 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 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 \
Expand Down