Skip to content

Commit

Permalink
ci: remove rhsm-host symlink and set a custom subscription name (#125)
Browse files Browse the repository at this point in the history
* Remove rhsm-host symlink and set a custom subscription name
* Restore the /etc/rhsm-host symlink after we don't need it

Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Jonathan Gonzalez V <[email protected]>
Co-authored-by: Jonathan Gonzalez V <[email protected]>
  • Loading branch information
NiccoloFei and sxd authored Dec 2, 2022
1 parent 40200f5 commit 9488eab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:
push: false
load: true
tags: ${{ env.TAGS }}
build-args: |
SUBSCRIPTION_NAME=docker-postgresql-cicd-${{ github.run_number }}
- name: Dockle scan
uses: erzz/dockle-action@v1
Expand All @@ -109,6 +111,8 @@ jobs:
push: true
tags: ${{ env.TAGS }}
labels: ${{ github.ref != 'refs/heads/main' && 'quay.expires-after=7d' || '' }}
build-args: |
SUBSCRIPTION_NAME=docker-postgresql-cicd-${{ github.run_number }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
tags: ${{ env.TAGS }}
load: true
build-args: |
SUBSCRIPTION_NAME=docker-postgresql-cicd-${{ github.run_number }}
${{ env.BUILD-ARGS }}
- name: History ${{ matrix.name }}
Expand Down
5 changes: 4 additions & 1 deletion UBI/Dockerfile-postgis.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# vim:set ft=dockerfile:
FROM quay.io/enterprisedb/edb-ubi:%%UBI_VERSION%%
ARG SUBSCRIPTION_NAME

# Do not split the description, otherwise we will see a blank space in the labels
LABEL name="PostgreSQL + PostGIS Container Images" \
Expand Down Expand Up @@ -61,7 +62,8 @@ RUN mkdir /docker-entrypoint-initdb.d
# Postgis
RUN --mount=type=secret,id=subscription,target=/run/secrets/subscription.sh \
set -xe ; \
bash /run/secrets/subscription.sh ; \
rm -f /etc/rhsm-host ; \
SUBSCRIPTION_NAME="${SUBSCRIPTION_NAME}" bash /run/secrets/subscription.sh ; \
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ; \
yum -y install --enablerepo=ubi-8-codeready-builder,codeready-builder-for-rhel-8-x86_64-rpms \
postgis%%POSTGIS_MAJOR%%_%%PG_MAJOR%%-%%POSTGIS_VERSION%% ; \
Expand All @@ -70,6 +72,7 @@ RUN --mount=type=secret,id=subscription,target=/run/secrets/subscription.sh \
subscription-manager unregister ; \
subscription-manager clean ; \
yum -y clean all --enablerepo='*' ; \
ln -sf /run/secrets/rhsm /etc/rhsm-host ; \
rm /var/log/rhsm/rhsm.log

COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
Expand Down

0 comments on commit 9488eab

Please sign in to comment.