|
1 | 1 | FROM openjdk:24-bullseye
|
2 | 2 |
|
3 |
| -ENV opt_dir=/opt/puppetlabs/server/apps/puppetserver |
4 |
| -ENV etc_dir=/etc/puppetlabs/puppetserver |
| 3 | +ADD puppetserver-8.6.3 /install |
5 | 4 |
|
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 |
7 | 13 |
|
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" |
9 | 54 |
|
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 |
16 | 56 |
|
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 \ |
35 | 65 | && ln -s /usr/local/openjdk-24/bin/java /usr/bin/java
|
| 66 | +# && /opt/puppetlabs/bin/puppetserver gem install puppet |
36 | 67 |
|
37 | 68 | EXPOSE 8140
|
38 | 69 |
|
39 |
| -ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"] |
40 |
| -CMD ["start"] |
| 70 | +# ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"] |
| 71 | +# CMD ["start"] |
0 commit comments