Skip to content

Commit 3691a30

Browse files
authored
Merge pull request #70 from OpenVoxProject/alpine_improvements
fix: make it work on alpine again
2 parents a47b2d5 + 70841dd commit 3691a30

11 files changed

Lines changed: 71 additions & 104 deletions

.github/workflows/build_container.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
OPENVOXDB_VERSION=${{ matrix.db_version }}
5757
R10K_VERSION=${{ matrix.r10k_version }}
5858
RUGGED_VERSION=${{ matrix.rugged_version }}
59+
JDK_VERSION=${{ matrix.jdk_version }}
5960
build_arch: linux/${{ matrix.platform }}
6061
build_context: openvoxserver
6162
buildfile: openvoxserver/Containerfile
@@ -71,6 +72,8 @@ jobs:
7172
OPENVOXSERVER_VERSION=${{ steps.server_version.outputs.server_version }}
7273
OPENVOXDB_VERSION=${{ steps.db_version.outputs.db_version }}
7374
R10K_VERSION=${{ matrix.r10k_version }}
75+
RUGGED_VERSION=${{ matrix.rugged_version }}
76+
JDK_VERSION=${{ matrix.jdk_version }}
7477
build_arch: linux/${{ matrix.platform }}
7578
build_context: openvoxserver
7679
buildfile: openvoxserver/Containerfile.alpine

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
OPENVOXDB_VERSION=${{ matrix.db_version }}
7272
R10K_VERSION=${{ matrix.r10k_version }}
7373
RUGGED_VERSION=${{ matrix.rugged_version }}
74+
JDK_VERSION=${{ matrix.jdk_version }}
7475
7576
- name: Build Alpine image
7677
uses: docker/build-push-action@v6
@@ -84,6 +85,8 @@ jobs:
8485
OPENVOXSERVER_VERSION=${{ steps.extract_server_version.outputs.server_version }}
8586
OPENVOXDB_VERSION=${{ steps.extract_db_version.outputs.db_version }}
8687
R10K_VERSION=${{ matrix.r10k_version }}
88+
RUGGED_VERSION=${{ matrix.rugged_version }}
89+
JDK_VERSION=${{ matrix.jdk_version }}
8790
8891
tests:
8992
needs:

.github/workflows/security_scanning.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
OPENVOXDB_VERSION=${{ matrix.db_version }}
6565
R10K_VERSION=${{ matrix.r10k_version }}
6666
RUGGED_VERSION=${{ matrix.rugged_version }}
67+
JDK_VERSION=${{ matrix.jdk_version }}
6768
6869
- name: Scan image with Anchore Grype
6970
uses: anchore/scan-action@v6

.markdownlint.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.markdownlint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
default: true
2+
MD033:
3+
allowed_elements:
4+
- br
5+
MD013:
6+
line_length: 210

build_versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ include:
77
db_version: "8.9.1-1+ubuntu24.04"
88
r10k_version: "5.0.0"
99
rugged_version: "1.9.0"
10+
jdk_version: "21"

openvoxserver/Containerfile.alpine

Lines changed: 50 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,82 @@
11
FROM alpine:3.22 AS base
22

33
# Install JDK
4+
ARG JDK_VERSION=17
45
RUN apk update && apk upgrade \
5-
&& apk add openjdk17-jre-headless \
6-
&& apk add --update bash \
7-
&& rm -rf /var/cache/apk/*
6+
&& apk add --no-cache openjdk${JDK_VERSION}-jre-headless bash
87

98
################################################################################
109

1110
FROM base AS build
1211

13-
ARG OPENVOXSERVER_VERSION=8.8.1
14-
ARG OPENVOXDB_VERSION=8.9.1
12+
ARG OPENVOXSERVER_VERSION=8.10.0
13+
ARG OPENVOXDB_VERSION=8.10.0
1514

1615
ADD https://artifacts.voxpupuli.org/openvox-server/${OPENVOXSERVER_VERSION}/openvox-server-${OPENVOXSERVER_VERSION}.tar.gz /
1716
ADD https://artifacts.voxpupuli.org/openvoxdb/${OPENVOXDB_VERSION}/openvoxdb-${OPENVOXDB_VERSION}.tar.gz /
1817

19-
ENV apps_dir=/opt/puppetlabs/server/apps
2018
ENV app_logdir=/var/log/puppetlabs
19+
ENV apps_dir=/opt/puppetlabs/server/apps
20+
ENV bindir=/opt/puppetlabs/server/apps/puppetserver/bin
2121
ENV data_dir=/opt/puppetlabs/server/data
2222
ENV etc_dir=/etc/puppetlabs
23+
ENV rubylibdir=/opt/puppetlabs/puppet/lib/ruby/vendor_ruby
2324
ENV run_dir=/var/run/puppetlabs
24-
ENV bindir=/opt/puppetlabs/server/apps/puppetserver/bin
2525
ENV symbindir=/opt/puppetlabs/server/bin
2626
ENV uxbindir=/opt/puppetlabs/bin
27-
ENV rubylibdir=/opt/puppetlabs/puppet/lib/ruby/vendor_ruby
2827

2928
RUN apk update \
3029
&& tar -xzf /openvox-server-${OPENVOXSERVER_VERSION}.tar.gz \
3130
&& tar -xzf /openvoxdb-${OPENVOXDB_VERSION}.tar.gz \
3231
&& cd /puppetserver-${OPENVOXSERVER_VERSION} \
32+
&& install -d -m 0700 "${app_logdir}/puppetserver" \
33+
&& install -d -m 0700 "${data_dir}/puppetserver/jars" \
34+
&& install -d -m 0700 "${data_dir}/puppetserver/yaml" \
35+
&& install -d -m 0750 "${etc_dir}/puppetserver/ca" \
3336
&& install -d -m 0755 "${apps_dir}/puppetserver" \
34-
&& install -d -m 0770 "${data_dir}/puppetserver" \
35-
&& install -m 0644 puppet-server-release.jar "${apps_dir}/puppetserver" \
36-
&& install -m 0774 ext/ezbake-functions.sh "${apps_dir}/puppetserver" \
37-
&& install -m 0644 ext/ezbake.manifest "${apps_dir}/puppetserver" \
38-
&& install -d -m 0755 "${etc_dir}/puppetserver/conf.d" \
39-
&& install -d -m 0755 "${etc_dir}/puppetserver/services.d" \
40-
&& install -d -m 0755 "${apps_dir}/puppetserver/config/services.d" \
41-
&& install -m 0644 ext/system-config/services.d/bootstrap.cfg "${apps_dir}/puppetserver/config/services.d/bootstrap.cfg" \
42-
&& install -m 0644 ext/config/request-logging.xml "${etc_dir}/puppetserver/request-logging.xml" \
43-
&& install -m 0644 ext/config/conf.d/puppetserver.conf "${etc_dir}/puppetserver/conf.d/puppetserver.conf" \
44-
&& install -m 0644 ext/config/logback.xml "${etc_dir}/puppetserver/logback.xml" \
45-
&& install -m 0644 ext/config/services.d/ca.cfg "${etc_dir}/puppetserver/services.d/ca.cfg" \
46-
&& install -m 0644 ext/config/conf.d/global.conf "${etc_dir}/puppetserver/conf.d/global.conf" \
47-
&& install -m 0644 ext/config/conf.d/web-routes.conf "${etc_dir}/puppetserver/conf.d/web-routes.conf" \
48-
&& install -m 0644 ext/config/conf.d/auth.conf "${etc_dir}/puppetserver/conf.d/auth.conf" \
49-
&& install -m 0644 ext/config/conf.d/metrics.conf "${etc_dir}/puppetserver/conf.d/metrics.conf" \
50-
&& install -m 0644 ext/config/conf.d/ca.conf "${etc_dir}/puppetserver/conf.d/ca.conf" \
51-
&& install -m 0644 ext/config/conf.d/webserver.conf "${etc_dir}/puppetserver/conf.d/webserver.conf" \
5237
&& install -d -m 0755 "${apps_dir}/puppetserver/cli" \
5338
&& install -d -m 0755 "${apps_dir}/puppetserver/cli/apps" \
39+
&& install -d -m 0755 "${apps_dir}/puppetserver/config/services.d" \
5440
&& install -d -m 0755 "${bindir}" \
41+
&& install -d -m 0755 "${data_dir}/puppetserver/jruby-gems" \
42+
&& install -d -m 0755 "${etc_dir}/code" \
43+
&& install -d -m 0755 "${etc_dir}/puppetserver/conf.d" \
44+
&& install -d -m 0755 "${etc_dir}/puppetserver/services.d" \
45+
&& install -d -m 0755 "${run_dir}/puppetserver" \
5546
&& install -d -m 0755 "${symbindir}" \
5647
&& install -d -m 0755 "${uxbindir}" \
57-
&& install -m 0755 "ext/bin/puppetserver" "${bindir}/puppetserver" \
58-
&& ln -s "../apps/puppetserver/bin/puppetserver" "${symbindir}/puppetserver" \
59-
&& ln -s "../server/apps/puppetserver/bin/puppetserver" "${uxbindir}/puppetserver" \
60-
&& install -m 0755 ext/cli/foreground "${apps_dir}/puppetserver/cli/apps/foreground" \
61-
&& install -m 0755 ext/cli/dropsonde "${apps_dir}/puppetserver/cli/apps/dropsonde" \
62-
&& install -m 0755 ext/cli/ca "${apps_dir}/puppetserver/cli/apps/ca" \
63-
&& install -m 0755 ext/cli/irb "${apps_dir}/puppetserver/cli/apps/irb" \
64-
&& install -m 0755 ext/cli/gem "${apps_dir}/puppetserver/cli/apps/gem" \
65-
&& install -m 0755 ext/cli/reload "${apps_dir}/puppetserver/cli/apps/reload" \
66-
&& install -m 0755 ext/cli/ruby "${apps_dir}/puppetserver/cli/apps/ruby" \
67-
&& install -m 0755 ext/cli/stop "${apps_dir}/puppetserver/cli/apps/stop" \
68-
&& install -m 0755 ext/cli/start "${apps_dir}/puppetserver/cli/apps/start" \
69-
&& install -m 0755 ext/cli_defaults/cli-defaults.sh "${apps_dir}/puppetserver/cli" \
70-
&& install -d -m 0700 "${app_logdir}/puppetserver" \
71-
&& install -d -m 0755 "${run_dir}/puppetserver" \
72-
&& install -d -m 700 "${data_dir}/puppetserver/jars" \
73-
&& install -d -m 700 "${data_dir}/puppetserver/yaml" \
74-
&& install -d /opt/puppetlabs/server/data/puppetserver/jruby-gems \
75-
&& install -d -m=775 /opt/puppetlabs/server/data \
76-
&& install -d "${etc_dir}/puppet/ssl" \
77-
&& install -d -m=755 "${etc_dir}/code" \
78-
&& install -d "${etc_dir}/puppetserver/ca" \
48+
&& install -d -m 0770 "${data_dir}/puppetserver" \
49+
&& install -d -m 0770 "${etc_dir}/puppet/ssl" \
50+
&& install -d -m 0775 "${data_dir}" \
51+
&& install -m 0644 ext/config/conf.d/auth.conf "${etc_dir}/puppetserver/conf.d/auth.conf" \
52+
&& install -m 0644 ext/config/conf.d/ca.conf "${etc_dir}/puppetserver/conf.d/ca.conf" \
53+
&& install -m 0644 ext/config/conf.d/global.conf "${etc_dir}/puppetserver/conf.d/global.conf" \
54+
&& install -m 0644 ext/config/conf.d/metrics.conf "${etc_dir}/puppetserver/conf.d/metrics.conf" \
55+
&& install -m 0644 ext/config/conf.d/puppetserver.conf "${etc_dir}/puppetserver/conf.d/puppetserver.conf" \
56+
&& install -m 0644 ext/config/conf.d/web-routes.conf "${etc_dir}/puppetserver/conf.d/web-routes.conf" \
57+
&& install -m 0644 ext/config/conf.d/webserver.conf "${etc_dir}/puppetserver/conf.d/webserver.conf" \
58+
&& install -m 0644 ext/config/logback.xml "${etc_dir}/puppetserver/logback.xml" \
59+
&& install -m 0644 ext/config/request-logging.xml "${etc_dir}/puppetserver/request-logging.xml" \
60+
&& install -m 0644 ext/config/services.d/ca.cfg "${etc_dir}/puppetserver/services.d/ca.cfg" \
61+
&& install -m 0644 ext/system-config/services.d/bootstrap.cfg "${apps_dir}/puppetserver/config/services.d/bootstrap.cfg" \
62+
&& install -m 0644 puppet-server-release.jar "${apps_dir}/puppetserver" \
63+
&& install -m 0755 ext/bin/puppetserver "${bindir}/puppetserver" \
64+
&& install -m 0755 ext/cli_defaults/cli-defaults.sh "${apps_dir}/puppetserver/cli" \
65+
&& install -m 0755 ext/cli/ca "${apps_dir}/puppetserver/cli/apps/ca" \
66+
&& install -m 0755 ext/cli/foreground "${apps_dir}/puppetserver/cli/apps/foreground" \
67+
&& install -m 0755 ext/cli/gem "${apps_dir}/puppetserver/cli/apps/gem" \
68+
&& install -m 0755 ext/cli/irb "${apps_dir}/puppetserver/cli/apps/irb" \
69+
&& install -m 0755 ext/cli/prune "${apps_dir}/puppetserver/cli/apps/prune" \
70+
&& install -m 0755 ext/cli/ruby "${apps_dir}/puppetserver/cli/apps/ruby" \
71+
&& ln -s "../apps/puppetserver/bin/puppetserver" "${symbindir}/puppetserver" \
72+
&& ln -s "../server/apps/puppetserver/bin/puppetserver" "${uxbindir}/puppetserver" \
7973
&& bash ext/build-scripts/install-vendored-gems.sh \
80-
### puppetdb-termini
74+
# puppetdb-termini
8175
&& cd /puppetdb-${OPENVOXDB_VERSION} \
82-
&& install -Dm 0644 puppet/face/node/deactivate.rb "${rubylibdir}/puppet/face/node/deactivate.rb" \
83-
&& install -Dm 0644 puppet/face/node/status.rb "${rubylibdir}/puppet/face/node/status.rb" \
84-
&& install -Dm 0644 puppet/functions/puppetdb_query.rb "${rubylibdir}/puppet/functions/puppetdb_query.rb" \
85-
&& install -Dm 0644 puppet/indirector/catalog/puppetdb.rb "${rubylibdir}/puppet/indirector/catalog/puppetdb.rb" \
86-
&& install -Dm 0644 puppet/indirector/facts/puppetdb_apply.rb "${rubylibdir}/puppet/indirector/facts/puppetdb_apply.rb" \
87-
&& install -Dm 0644 puppet/indirector/facts/puppetdb.rb "${rubylibdir}/puppet/indirector/facts/puppetdb.rb" \
88-
&& install -Dm 0644 puppet/indirector/node/puppetdb.rb "${rubylibdir}/puppet/indirector/node/puppetdb.rb" \
89-
&& install -Dm 0644 puppet/indirector/resource/puppetdb.rb "${rubylibdir}/puppet/indirector/resource/puppetdb.rb" \
90-
&& install -Dm 0644 puppet/reports/puppetdb.rb "${rubylibdir}/puppet/reports/puppetdb.rb" \
91-
&& install -Dm 0644 puppet/util/puppetdb.rb "${rubylibdir}/puppet/util/puppetdb.rb" \
92-
&& install -Dm 0644 puppet/util/puppetdb/atom.rb "${rubylibdir}/puppet/util/puppetdb/atom.rb" \
93-
&& install -Dm 0644 puppet/util/puppetdb/char_encoding.rb "${rubylibdir}/puppet/util/puppetdb/char_encoding.rb" \
94-
&& install -Dm 0644 puppet/util/puppetdb/command_names.rb "${rubylibdir}/puppet/util/puppetdb/command_names.rb" \
95-
&& install -Dm 0644 puppet/util/puppetdb/command.rb "${rubylibdir}/puppet/util/puppetdb/command.rb" \
96-
&& install -Dm 0644 puppet/util/puppetdb/config.rb "${rubylibdir}/puppet/util/puppetdb/config.rb" \
97-
&& install -Dm 0644 puppet/util/puppetdb/http.rb "${rubylibdir}/puppet/util/puppetdb/http.rb"
76+
&& for f in puppet/face/node/deactivate.rb puppet/face/node/status.rb puppet/functions/puppetdb_query.rb puppet/indirector/catalog/puppetdb.rb puppet/indirector/facts/puppetdb_apply.rb puppet/indirector/facts/puppetdb.rb puppet/indirector/node/puppetdb.rb puppet/indirector/resource/puppetdb.rb puppet/reports/puppetdb.rb puppet/util/puppetdb.rb puppet/util/puppetdb/atom.rb puppet/util/puppetdb/char_encoding.rb puppet/util/puppetdb/command_names.rb puppet/util/puppetdb/command.rb puppet/util/puppetdb/config.rb puppet/util/puppetdb/http.rb; do \
77+
install -Dm 0644 $f "${rubylibdir}/$f"; \
78+
done \
79+
&& rm -rf /openvox-server-${OPENVOXSERVER_VERSION}.tar.gz /openvoxdb-${OPENVOXDB_VERSION}.tar.gz /puppetserver-${OPENVOXSERVER_VERSION} /puppetdb-${OPENVOXDB_VERSION}
9880

9981
################################################################################
10082

@@ -179,22 +161,8 @@ COPY puppetserver /etc/default/puppetserver
179161
COPY request-logging.xml /etc/puppetlabs/puppetserver/
180162

181163
RUN apk update \
182-
&& apk add --update dumb-init \
183-
&& apk add --update alpine-sdk \
184-
&& apk add --update openssh-client \
185-
&& apk add --update openssl \
186-
&& apk add --update libssh2 \
187-
&& apk add --update ruby \
188-
&& apk add --update ruby-dev \
189-
# && apk add --update cmake \
190-
# install puppet gem as agent into system ruby
191-
&& gem install --no-doc puppet -v 8.10.0 \
192-
&& gem install --no-doc hocon -v 1.4.0 \
193-
&& gem install --no-doc racc -v 1.8.1 \
194-
&& gem install --no-doc r10k -v ${R10K_VERSION} \
195-
&& gem install --no-doc hiera-eyaml -v 4.1.0 \
196-
&& gem install --no-doc puppetserver-ca -v 2.6.0 \
197-
# && gem install --no-doc rugged -- --with-ssh \
164+
&& apk add --no-cache dumb-init alpine-sdk openssh-client openssl libssh2 ruby ruby-dev runuser coreutils gcompat \
165+
&& gem install --no-document openvox:8.21.1 syslog hocon:1.4.0 racc:1.8.1 r10k:${R10K_VERSION} hiera-eyaml:4.3.0 openvoxserver-ca:3.0.0 \
198166
&& apk del --purge alpine-sdk \
199167
&& addgroup -g 1001 puppet \
200168
&& adduser -G puppet -u 1001 -h ${data_dir}/puppetserver -H -D -s /sbin/nologin puppet \
@@ -222,7 +190,7 @@ RUN apk update \
222190
&& ln -s /usr/bin/r10k /opt/puppetlabs/puppet/bin/r10k \
223191
&& ln -s /usr/bin/hiera-eyaml /opt/puppetlabs/puppet/bin/hiera-eyaml \
224192
# install puppet gem as library into jruby loadpath
225-
&& puppetserver gem install puppet
193+
&& puppetserver gem install --no-document openvox
226194

227195
# k8s uses livenessProbe, startupProbe, readinessProbe and ignores HEALTHCHECK
228196
HEALTHCHECK --interval=20s --timeout=15s --retries=12 --start-period=3m CMD ["/healthcheck.sh"]

openvoxserver/container-entrypoint.d/20-use-templates-initially.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ set -e
88
TEMPLATES=/var/tmp/puppet
99

1010
cd /etc/puppetlabs/puppet
11-
for f in auth.conf hiera.yaml puppet.conf puppetdb.conf
12-
do
13-
test -f "$TEMPLATES/$f" && cp -p --update=none "$TEMPLATES/$f" .
11+
for f in auth.conf hiera.yaml puppet.conf puppetdb.conf; do
12+
[ -f "$TEMPLATES/$f" ] && [ ! -f "$f" ] && {
13+
echo "Copying template $f from $TEMPLATES"
14+
cp -p "$TEMPLATES/$f" .
15+
}
1416
done
1517
cd /
1618

openvoxserver/container-entrypoint.d/55-set-masterport.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
set -e
44

5-
hocon() {
6-
/opt/puppetlabs/puppet/lib/ruby/vendor_gems/bin/hocon "$@"
7-
}
8-
95
if test -n "$OPENVOXSERVER_PORT"; then
106
cd /etc/puppetlabs/puppetserver/conf.d/
117
hocon -f webserver.conf set webserver.ssl-port $OPENVOXSERVER_PORT

openvoxserver/container-entrypoint.d/90-ca.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ ca_running() {
77
test "$status" = "running"
88
}
99

10-
hocon() {
11-
/opt/puppetlabs/puppet/lib/ruby/vendor_gems/bin/hocon "$@"
12-
}
13-
1410
if [[ "$CA_ENABLED" != "true" ]]; then
1511
# we are just an ordinary compiler
1612
echo "turning off CA"

0 commit comments

Comments
 (0)