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

More flexible container images for the official images #729

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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') \
oliveromahony marked this conversation as resolved.
Show resolved Hide resolved
--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 #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"

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.
Expand Down
Loading