Skip to content

Commit

Permalink
build from tar
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Waffen <[email protected]>
  • Loading branch information
rwaffen committed Oct 9, 2024
1 parent ddf7a2b commit fb38a85
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
40 changes: 40 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM openjdk:24-bullseye

ENV opt_dir=/opt/puppetlabs/server/apps/puppetserver
ENV etc_dir=/etc/puppetlabs/puppetserver

WORKDIR $opt_dir

COPY puppet-server-release.jar $opt_dir/puppet-server-release.jar

COPY ext/cli $opt_dir/cli/apps
COPY ext/cli_defaults/cli-defaults.sh $opt_dir/cli/cli-defaults.sh
COPY ext/bin $opt_dir/bin
COPY ext/bin/puppetserver /opt/puppetlabs/bin/puppetserver
COPY ext/ezbake-functions.sh $opt_dir/ezbake-functions.sh
COPY install.sh $opt_dir/scripts/install.sh

COPY ext/ezbake.manifest $opt_dir/ezbake.manifest
COPY ext/system-config/services.d/bootstrap.cfg $opt_dir/config/services.d/bootstrap.cfg
COPY ext/config/conf.d $etc_dir/conf.d
COPY ext/config/services.d $etc_dir/services.d
COPY ext/default /etc/default/puppetserver

COPY ext/config/logback.xml \
ext/config/request-logging.xml \
${etc_dir}

RUN useradd --uid 1001 --home-dir ${opt_dir} --shell /usr/sbin/nologin --user-group puppet \
&& chown -R puppet:puppet /opt/puppetlabs \
&& chown -R puppet:puppet /etc/puppetlabs \
&& chmod +x /opt/puppetlabs/bin/* \
&& chmod +x ${opt_dir}/bin/* \
&& chmod +x ${opt_dir}/cli/**/* \
&& chmod +x ${opt_dir}/scripts/* \
&& chmod +x ${opt_dir}/ezbake-functions.sh \
&& ln -s /usr/local/openjdk-24/bin/java /usr/bin/java

EXPOSE 8140

ENTRYPOINT ["/opt/puppetlabs/bin/puppetserver"]
CMD ["start"]
15 changes: 15 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

software_version=${1:-8.6.2}
container_version=${2:-1.0.0}

curl -v https://downloads.puppet.com/puppet/puppetserver-${software_version}.tar.gz -o puppetserver-${software_version}.tar.gz
tar -xvf puppetserver-${software_version}.tar.gz

cp Dockerfile puppetserver-${software_version}/
cd puppetserver-${software_version}
docker build -t puppetserver:${software_version}-v${container_version} .

cd -
rm -rf puppetserver-${software_version}
rm puppetserver-${software_version}.tar.gz

0 comments on commit fb38a85

Please sign in to comment.