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

Update build #10

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: 'PUPPET_VERSION=7'
build_args: 'PUPPET_RELEASE=7,PUPPET_VERSION=${{ github.ref_name }}}}'
build_arch: linux/amd64,linux/arm64
buildfile: 'puppetdb/Dockerfile'
if: ${{ startsWith(github.ref_name, 'v7') }}
if: ${{ startsWith(github.ref_name, '7') }}

- name: Build PuppetDB 8 container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: 'PUPPET_VERSION=8'
build_args: 'PUPPET_RELEASE=8,PUPPET_VERSION=${{ github.ref_name }}}}'
build_arch: linux/amd64,linux/arm64
buildfile: 'puppetdb/Dockerfile'
if: ${{ startsWith(github.ref_name, 'v8') }}
if: ${{ startsWith(github.ref_name, '8') }}
26 changes: 9 additions & 17 deletions puppetdb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ FROM ubuntu:22.04 as base
ARG DUMB_INIT_VERSION="1.2.5"
ARG LOGDIR

ENV PUPPERWARE_ANALYTICS_ENABLED=false \
PUPPETDB_POSTGRES_HOSTNAME="postgres" \
ENV PUPPETDB_POSTGRES_HOSTNAME="postgres" \
PUPPETDB_POSTGRES_PORT="5432" \
PUPPETDB_POSTGRES_DATABASE="puppetdb" \
CERTNAME=puppetdb \
Expand Down Expand Up @@ -81,10 +80,12 @@ RUN apt update && \

FROM base as release

ARG PUPPET_VERSION
ENV PUPPET_VERSION=${PUPPET_VERSION:-7}
ARG PUPPET_RELEASE
ENV PUPPET_RELEASE=${PUPPET_RELEASE:-7}

ARG PUPPETDB_VERSION
ENV PUPPETDB_VERSION=${PUPPETDB_VERSION:-7.14.0}

ARG version
ARG UBUNTU_CODENAME

######################################################
Expand All @@ -96,21 +97,17 @@ ARG UBUNTU_CODENAME
FROM ${build_type} as final

ARG vcs_ref
ARG version
ARG build_date
ARG build_type
# used by entrypoint to submit metrics to Google Analytics;
# published images should use "production" for this build_arg
ARG pupperware_analytics_stream="dev"
ARG LOGDIR

ENV PUPPET_DEB=puppet${PUPPET_VERSION}-release-$UBUNTU_CODENAME.deb
ENV PUPPET_DEB=puppet${PUPPET_RELEASE}-release-${UBUNTU_CODENAME}.deb
ADD https://apt.puppet.com/${PUPPET_DEB} /${PUPPET_DEB}

RUN dpkg -i /${PUPPET_DEB} && \
rm /${PUPPET_DEB} && \
apt update && \
apt install --no-install-recommends -y puppetdb && \
apt install --no-install-recommends -y puppetdb=${PUPPETDB_VERSION}-1${UBUNTU_CODENAME} && \
apt autoremove && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p "$LOGDIR" && \
Expand All @@ -125,12 +122,7 @@ COPY logback.xml \
COPY conf.d /etc/puppetlabs/puppetdb/conf.d/
COPY puppetdb /etc/default/puppetdb

ENV PUPPERWARE_ANALYTICS_STREAM="$pupperware_analytics_stream" \
PUPPETDB_VERSION="$version"

LABEL org.label-schema.name="PuppetDB ($build_type)" \
org.label-schema.vcs-ref="$vcs_ref" \
org.label-schema.version="$version" \
org.label-schema.version="$PUPPETDB_VERSION" \
org.label-schema.build-date="$build_date"

COPY Dockerfile /