Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit be3577b

Browse files
committed
feat: reverse engineer build from install.sh and Makefile
Signed-off-by: Robert Waffen <[email protected]>
1 parent fb38a85 commit be3577b

File tree

3 files changed

+85
-40
lines changed

3 files changed

+85
-40
lines changed

build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
puppet-*
2+
puppetserver-*

build/Dockerfile

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,71 @@
11
FROM openjdk:24-bullseye
22

3-
ENV opt_dir=/opt/puppetlabs/server/apps/puppetserver
4-
ENV etc_dir=/etc/puppetlabs/puppetserver
3+
ADD puppetserver-8.6.3 /install
54

6-
WORKDIR $opt_dir
5+
ENV apps_dir=/opt/puppetlabs/server/apps
6+
ENV app_logdir=/var/log/puppetlabs/puppetserver
7+
ENV data_dir=/opt/puppetlabs/server/data
8+
ENV etc_dir=/etc/puppetlabs
9+
ENV rundir=/var/run/puppetlabs/puppetserver
10+
ENV bindir=/opt/puppetlabs/server/apps/puppetserver/bin
11+
ENV symbindir=/opt/puppetlabs/server/bin
12+
ENV uxbindir=/opt/puppetlabs/bin
713

8-
COPY puppet-server-release.jar $opt_dir/puppet-server-release.jar
14+
RUN cd /install \
15+
&& install -d -m 0755 "${apps_dir}/puppetserver" \
16+
&& install -d -m 0770 "${data_dir}/puppetserver" \
17+
&& install -m 0644 puppet-server-release.jar "${apps_dir}/puppetserver" \
18+
&& install -m 0774 ext/ezbake-functions.sh "${apps_dir}/puppetserver" \
19+
&& install -m 0644 ext/ezbake.manifest "${apps_dir}/puppetserver" \
20+
&& install -d -m 0755 "${etc_dir}/puppetserver/conf.d" \
21+
&& install -d -m 0755 "${etc_dir}/puppetserver/services.d" \
22+
&& install -m 0644 ext/config/request-logging.xml "${etc_dir}/puppetserver/request-logging.xml" \
23+
&& install -m 0644 ext/config/conf.d/puppetserver.conf "${etc_dir}/puppetserver/conf.d/puppetserver.conf" \
24+
&& install -m 0644 ext/config/logback.xml "${etc_dir}/puppetserver/logback.xml" \
25+
&& install -m 0644 ext/config/services.d/ca.cfg "${etc_dir}/puppetserver/services.d/ca.cfg" \
26+
&& install -m 0644 ext/config/conf.d/global.conf "${etc_dir}/puppetserver/conf.d/global.conf" \
27+
&& install -m 0644 ext/config/conf.d/web-routes.conf "${etc_dir}/puppetserver/conf.d/web-routes.conf" \
28+
&& install -m 0644 ext/config/conf.d/auth.conf "${etc_dir}/puppetserver/conf.d/auth.conf" \
29+
&& install -m 0644 ext/config/conf.d/metrics.conf "${etc_dir}/puppetserver/conf.d/metrics.conf" \
30+
&& install -m 0644 ext/config/conf.d/ca.conf "${etc_dir}/puppetserver/conf.d/ca.conf" \
31+
&& install -m 0644 ext/config/conf.d/webserver.conf "${etc_dir}/puppetserver/conf.d/webserver.conf" \
32+
&& install -d -m 0755 "${apps_dir}/puppetserver/cli" \
33+
&& install -d -m 0755 "${apps_dir}/puppetserver/cli/apps" \
34+
&& install -d -m 0755 "${bindir}" \
35+
&& install -d -m 0755 "${symbindir}" \
36+
&& install -d -m 0755 "${uxbindir}" \
37+
&& install -m 0755 "ext/bin/puppetserver" "${bindir}/puppetserver" \
38+
&& ln -s "../apps/puppetserver/bin/puppetserver" "${symbindir}/puppetserver" \
39+
&& ln -s "../server/apps/puppetserver/bin/puppetserver" "${uxbindir}/puppetserver" \
40+
&& install -m 0755 ext/cli/foreground "${apps_dir}/puppetserver/cli/apps/foreground" \
41+
&& install -m 0755 ext/cli/dropsonde "${apps_dir}/puppetserver/cli/apps/dropsonde" \
42+
&& install -m 0755 ext/cli/ca "${apps_dir}/puppetserver/cli/apps/ca" \
43+
&& install -m 0755 ext/cli/irb "${apps_dir}/puppetserver/cli/apps/irb" \
44+
&& install -m 0755 ext/cli/gem "${apps_dir}/puppetserver/cli/apps/gem" \
45+
&& install -m 0755 ext/cli/reload "${apps_dir}/puppetserver/cli/apps/reload" \
46+
&& install -m 0755 ext/cli/ruby "${apps_dir}/puppetserver/cli/apps/ruby" \
47+
&& install -m 0755 ext/cli/stop "${apps_dir}/puppetserver/cli/apps/stop" \
48+
&& install -m 0755 ext/cli/start "${apps_dir}/puppetserver/cli/apps/start" \
49+
&& install -m 0644 puppet-server-release.jar "${apps_dir}/puppetserver" \
50+
&& install -d -m 0700 "${app_logdir}" \
51+
&& install -d -m 0755 "${rundir}" \
52+
&& install -d -m 700 "${data_dir}/puppetserver/jars" \
53+
&& install -d -m 700 "${data_dir}/puppetserver/yaml"
954

10-
COPY ext/cli $opt_dir/cli/apps
11-
COPY ext/cli_defaults/cli-defaults.sh $opt_dir/cli/cli-defaults.sh
12-
COPY ext/bin $opt_dir/bin
13-
COPY ext/bin/puppetserver /opt/puppetlabs/bin/puppetserver
14-
COPY ext/ezbake-functions.sh $opt_dir/ezbake-functions.sh
15-
COPY install.sh $opt_dir/scripts/install.sh
55+
RUN echo 'alias ll="ls -la --color=auto"' >> ~/.bashrc
1656

17-
COPY ext/ezbake.manifest $opt_dir/ezbake.manifest
18-
COPY ext/system-config/services.d/bootstrap.cfg $opt_dir/config/services.d/bootstrap.cfg
19-
COPY ext/config/conf.d $etc_dir/conf.d
20-
COPY ext/config/services.d $etc_dir/services.d
21-
COPY ext/default /etc/default/puppetserver
22-
23-
COPY ext/config/logback.xml \
24-
ext/config/request-logging.xml \
25-
${etc_dir}
26-
27-
RUN useradd --uid 1001 --home-dir ${opt_dir} --shell /usr/sbin/nologin --user-group puppet \
28-
&& chown -R puppet:puppet /opt/puppetlabs \
29-
&& chown -R puppet:puppet /etc/puppetlabs \
30-
&& chmod +x /opt/puppetlabs/bin/* \
31-
&& chmod +x ${opt_dir}/bin/* \
32-
&& chmod +x ${opt_dir}/cli/**/* \
33-
&& chmod +x ${opt_dir}/scripts/* \
34-
&& chmod +x ${opt_dir}/ezbake-functions.sh \
57+
RUN useradd --uid 1001 --home-dir ${data_dir}/puppetserver --shell /usr/sbin/nologin --user-group puppet \
58+
&& install --owner=puppet --group=puppet -d /opt/puppetlabs/server/data/puppetserver/jruby-gems \
59+
&& install --directory --owner=puppet --group=puppet --mode=775 /opt/puppetlabs/server/data \
60+
&& install --directory "${etc_dir}/puppet/ssl" \
61+
&& install --directory "${etc_dir}/puppetserver/ca" \
62+
&& chown -R puppet:puppet ${etc_dir}/puppet/ssl \
63+
&& chown -R puppet:puppet ${etc_dir}/puppetserver/ca \
64+
&& find /etc/puppetlabs/puppet/ssl -type d -print0 | xargs -0 chmod 770 \
3565
&& ln -s /usr/local/openjdk-24/bin/java /usr/bin/java
66+
# && /opt/puppetlabs/bin/puppetserver gem install puppet
3667

3768
EXPOSE 8140
3869

39-
ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"]
40-
CMD ["start"]
70+
# ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"]
71+
# CMD ["start"]

build/build.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
#!/bin/bash
22

3-
software_version=${1:-8.6.2}
4-
container_version=${2:-1.0.0}
3+
pps_version=${1:-8.6.3}
4+
pp_version=${2:-8.9.0}
5+
container_version=${3:-1.0.1}
56

6-
curl -v https://downloads.puppet.com/puppet/puppetserver-${software_version}.tar.gz -o puppetserver-${software_version}.tar.gz
7-
tar -xvf puppetserver-${software_version}.tar.gz
7+
if [ -d puppetserver-${pps_version} ]; then
8+
rm -rf puppetserver-${pps_version}
9+
fi
810

9-
cp Dockerfile puppetserver-${software_version}/
10-
cd puppetserver-${software_version}
11-
docker build -t puppetserver:${software_version}-v${container_version} .
11+
if [ -d puppet-${pp_version} ]; then
12+
rm -rf puppet-${pp_version}
13+
fi
1214

13-
cd -
14-
rm -rf puppetserver-${software_version}
15-
rm puppetserver-${software_version}.tar.gz
15+
if [ ! -f puppetserver-${pps_version}.tar.gz ]; then
16+
curl -v https://downloads.puppet.com/puppet/puppetserver-${pps_version}.tar.gz -o puppetserver-${pps_version}.tar.gz
17+
fi
18+
if [ ! -f puppet-${pp_version}.tar.gz ]; then
19+
curl -v https://downloads.puppet.com/puppet/puppet-${pp_version}.tar.gz -o puppet-${pp_version}.tar.gz
20+
fi
21+
22+
tar -xf puppetserver-${pps_version}.tar.gz
23+
tar -xf puppet-${pp_version}.tar.gz
24+
25+
# cp Dockerfile puppetserver-${pps_version}/
26+
# cd puppetserver-${pps_version}
27+
docker build -t puppetserver:${pps_version}-v${container_version} .

0 commit comments

Comments
 (0)