Skip to content

Commit

Permalink
Deregister subscription-manager on nap ubi build (#1965)
Browse files Browse the repository at this point in the history
* Deregister subscription-manager on nap ubi build

* Don't print subscription manager details to terminal
  • Loading branch information
ciarams87 committed Sep 15, 2021
1 parent 4abc210 commit 32f968d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build/Dockerfile
Expand Up @@ -141,16 +141,17 @@ ARG NGINX_PLUS_VERSION
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
--mount=type=secret,id=rhel_license,dst=/tmp/rhel_license,mode=0644 \
set -x \
&& source /tmp/rhel_license \
&& curl -sS https://cs.nginx.com/static/files/app-protect-7.repo > /etc/yum.repos.d/app-protect-7.repo \
source /tmp/rhel_license \
&& subscription-manager register --org=${RHEL_ORGANIZATION} --activationkey=${RHEL_ACTIVATION_KEY} || true \
&& subscription-manager attach --auto \
&& subscription-manager attach \
&& set -x \
&& curl -sS https://cs.nginx.com/static/files/app-protect-7.repo > /etc/yum.repos.d/app-protect-7.repo \
&& subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms \
&& rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum clean all \
&& yum install -y nginx-plus-module-appprotect-${NGINX_PLUS_VERSION} $(repoquery app-protect-${NGINX_PLUS_VERSION#r}*) app-protect-attack-signatures app-protect-threat-campaigns \
&& rm /etc/yum.repos.d/app-protect-7.repo
&& rm /etc/yum.repos.d/app-protect-7.repo \
&& subscription-manager unregister

# Uncomment the lines below if you want to install a custom CA certificate
# COPY build/*.crt /etc/pki/ca-trust/source/anchors/
Expand Down

0 comments on commit 32f968d

Please sign in to comment.