diff --git a/Makefile b/Makefile index b086035a0..4904b0d0c 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ include Makefile.tools # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Variable Definitions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -VERSION = $(shell git describe --match "v[0-9]*" --abbrev=0 --tags) +VERSION ?= $(shell git describe --match "v[0-9]*" --abbrev=0 --tags) ifeq ($(VERSION),) - VERSION = $(shell curl https://api.github.com/repos/nginx/agent/releases/latest -s | jq .name -r) + VERSION ?= $(shell curl https://api.github.com/repos/nginx/agent/releases/latest -s | jq .name -r) endif COMMIT = $(shell git rev-parse --short HEAD) DATE = $(shell date +%F_%H-%M-%S) @@ -307,8 +307,18 @@ official-oss-image: ## Build official NGINX OSS with NGINX Agent container image @echo Building image nginx-oss-with-nginx-agent with $(CONTAINER_CLITOOL); \ cd scripts/docker/official/nginx-oss-with-nginx-agent/alpine/ \ && $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t nginx-oss-with-nginx-agent . \ + --build-arg NGINX_AGENT_VERSION=$(shell echo ${VERSION} | tr -d 'v') \ --no-cache -f ./Dockerfile.mainline +official-oss-stable-image: ## Build official NGINX OSS with NGINX Agent container stable image + @echo Building image nginx-oss-with-nginx-agent with $(CONTAINER_CLITOOL); \ + cd scripts/docker/official/nginx-oss-with-nginx-agent/alpine/ \ + && $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t nginx-oss-with-nginx-agent . \ + --build-arg NGINX_AGENT_VERSION=$(shell echo ${VERSION} | tr -d 'v') \ + --no-cache -f ./Dockerfile.stable + +official-oss-mainline-image: official-oss-image ## Build official NGINX OSS with NGINX Agent container mainline image + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Grafana Example Dashboard Targets # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # diff --git a/README.md b/README.md index bcd29e44e..680e5c765 100644 --- a/README.md +++ b/README.md @@ -163,11 +163,18 @@ If you need to make changes to the default configuration you can update the file For more detail on logrotate configuration see [Logrotate Configuration Options](https://linux.die.net/man/8/logrotate) ## Building Docker Image -To build an image that contains the latest NGINX Agent and the latest mainline version of NGINX OSS run the following command: -``` +To build an image that contains the latest NGINX Agent, the latest mainline version of NGINX OSS on latest Alpine run the following command: + +```make make official-oss-image ``` +To build an image that contains the latest NGINX Agent, the latest stable version of NGINX OSS on latest Alpine run the following command: + +```make +make official-oss-stable-image +``` + For more information on how to run NGINX Agent containers and how build an image that uses NGINX Plus instead of NGINX OSS see [Docker Images](https://docs.nginx.com/nginx-agent/installation-upgrade/container-environments/docker-images/) # Getting Started with NGINX Agent diff --git a/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.mainline b/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.mainline index a39d3c216..e4e65ff18 100644 --- a/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.mainline +++ b/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.mainline @@ -1,9 +1,9 @@ -ARG NGINX_VERSION=1.25.1-alpine +ARG NGINX_VERSION=mainline-alpine-slim FROM nginx:${NGINX_VERSION} LABEL maintainer="NGINX Docker Maintainers " -ARG NGINX_AGENT_VERSION=2.27.0 +ARG NGINX_AGENT_VERSION # Unlink symbolic links for access and error logs as the NGINX Agent # requires both files to be able to monitor NGINX and provide metrics. diff --git a/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.stable b/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.stable index 67ba94280..1cc6b3107 100644 --- a/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.stable +++ b/scripts/docker/official/nginx-oss-with-nginx-agent/alpine/Dockerfile.stable @@ -1,9 +1,9 @@ -ARG NGINX_VERSION=1.24.0-alpine +ARG NGINX_VERSION=stable-alpine-slim FROM nginx:${NGINX_VERSION} LABEL maintainer="NGINX Docker Maintainers " -ARG NGINX_AGENT_VERSION=2.27.0 +ARG NGINX_AGENT_VERSION # Unlink symbolic links for access and error logs as the NGINX Agent # requires both files to be able to monitor NGINX and provide metrics.