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

Renamed demo and added unprivileged docker image support #173

Merged
merged 5 commits into from
Jan 8, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ utilizing *fleet* and *etcd*.

* **mysql-galera-demo**: This demo uses NGINX Plus as a TCP load balancer for a MySQL Galera cluster consisting of two mysqld servers. It does round-robin load balancing between the 2 mysqld servers and also does active health checks using an xinetd script running on port 9200 inside each mysqld container.

* **nginx-agent-docker**: This demo helps building a docker image to deploy NGINX Plus and NGINX Agent for NGINX Management Suite, with optional support for NGINX App Protect WAF and NGINX Developer Portal for API Connectivity Manager
* **nginx-docker-builder**: This demo helps building a docker image to deploy NGINX Plus (privileged and unprivileged), NGINX App Protect WAF and NGINX Agent for NGINX Instance Manager and NGINX One Console

* **nginx-hello**: NGINX running as webserver in a docker container that serves a simple page containing the container's hostname, IP address and port

Expand Down
109 changes: 0 additions & 109 deletions nginx-agent-docker/README.md

This file was deleted.

82 changes: 0 additions & 82 deletions nginx-agent-docker/container/start.sh

This file was deleted.

95 changes: 0 additions & 95 deletions nginx-agent-docker/manifests/1.nginx-with-agent.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions nginx-agent-docker/scripts/nginxWithAgentStart.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM nginx:stable-bullseye-perl

ARG NMS_URL
ARG NGINX_AGENT=false

# Initial packages setup
RUN apt-get -y update \
Expand All @@ -15,10 +16,13 @@ RUN apt-get -y update \
&& groupadd -g 1001 nginx-agent \
&& usermod root -G nginx-agent \
&& usermod nginx -G nginx-agent \
# NGINX Instance Manager agent installation
&& if [ `curl -o /dev/null -sk -w "%{http_code}\n" $NMS_URL/install/nginx-agent` = 200 ] ; then \
bash -c 'export DATA_PLANE_KEY="placeholder" && curl -k $NMS_URL/install/nginx-agent | sh' && echo "NGINX Agent installed"; else \
bash -c 'export DATA_PLANE_KEY="placeholder" && curl -k $NMS_URL/nginx-agent/install | sh || :' && echo "NGINX Agent installed"; fi
# NGINX Agent
&& if [ "$NGINX_AGENT" = "true" ] ; then \
apt-get -y install curl gnupg2 ca-certificates lsb-release debian-archive-keyring \
&& curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://packages.nginx.org/nginx-agent/debian/ `lsb_release -cs` agent" > /etc/apt/sources.list.d/nginx-agent.list \
&& apt-get -y update \
&& apt-get -y install nginx-agent; fi

# Startup script
COPY ./container/start.sh /deployment/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:bullseye-slim

ARG NMS_URL
ARG NAP_WAF=false
ARG NGINX_AGENT=false

# Initial packages setup
RUN apt-get -y update \
Expand All @@ -12,7 +12,7 @@ RUN apt-get -y update \
&& wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq \
&& chmod +x /usr/bin/yq

# Use certificate and key from kubernetes secret
# Use certificate and key from secret
RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
--mount=type=secret,id=nginx-key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
set -x \
Expand All @@ -32,14 +32,12 @@ RUN --mount=type=secret,id=nginx-crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644
# Forward request logs to Docker log collector
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
# User and group
&& groupadd -g 1001 nginx-agent \
&& usermod root -G nginx-agent \
&& usermod nginx -G nginx-agent \
# NGINX Instance Manager agent installation
&& if [ `curl -o /dev/null -sk -w "%{http_code}\n" $NMS_URL/install/nginx-agent` = 200 ] ; then \
bash -c 'export DATA_PLANE_KEY="placeholder" && curl -k $NMS_URL/install/nginx-agent | sh' && echo "NGINX Agent installed"; else \
bash -c 'export DATA_PLANE_KEY="placeholder" && curl -k $NMS_URL/nginx-agent/install | sh || :' && echo "NGINX Agent installed"; fi
# NGINX Agent
&& if [ "$NGINX_AGENT" = "true" ] ; then \
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://packages.nginx.org/nginx-agent/debian/ `lsb_release -cs` agent" > /etc/apt/sources.list.d/nginx-agent.list \
&& apt-get -y update \
&& apt-get -y install nginx-agent; fi

# Startup script
COPY ./container/start.sh /deployment/
Expand Down
Loading
Loading