|
| 1 | +# This Dockerfile enables an iterative development workflow where you can make |
| 2 | +# a change and test it out quickly. The majority of commands in this file will |
| 3 | +# be cached, making the feedback loop typically quite short. The workflow is |
| 4 | +# as follows: |
| 5 | +# 1. Set up pre-conditions for the system in puppet code using `deploy.pp`. |
| 6 | +# 2. Make a change to the module. |
| 7 | +# 3. Run `./docker/bin/install.sh rocky` from the project directory. |
| 8 | +# 4. Review the output. Repeat steps 2-3 as needed. |
| 9 | +# |
| 10 | +# At the end of execution, you will see a line like: |
| 11 | +# |
| 12 | +# (19/19) Installing: puppet-agent-8.11.0-1.sles15.x86_64 ..........................................................................[done] |
| 13 | + |
| 14 | +ARG BASE_IMAGE=registry.suse.com/suse/sle15:15.6 |
| 15 | +FROM ${BASE_IMAGE} |
| 16 | + |
| 17 | +# Use this to force a cache reset (e.g. for output purposes) |
| 18 | +#COPY $0 /tmp/Dockerfile |
| 19 | + |
| 20 | +# Install some other dependencies for ease of life. |
| 21 | +RUN zypper install --no-confirm wget git-core |
| 22 | + |
| 23 | +# This is also duplicated in the docker/bin/helpers/run-upgrade.sh. |
| 24 | +ENV module_path=/tmp/modules |
| 25 | +WORKDIR "${module_path}/puppet_agent" |
| 26 | +COPY metadata.json ./ |
| 27 | + |
| 28 | +# Installing dependencies from source. These versions should be within the range |
| 29 | +# of `dependencies` in metadata.json. |
| 30 | +RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch v9.7.0 |
| 31 | +RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch v6.2.0 |
| 32 | +RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-apt ../apt --branch v10.0.1 |
| 33 | +RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0 |
| 34 | + |
| 35 | +# Now move the project directory's files into the image. That way, if these |
| 36 | +# files change, caching will skip everything before this. |
| 37 | +COPY docker/bin/helpers/run-install.sh /tmp/bin/run-install.sh |
| 38 | +COPY files/ ./files/ |
| 39 | +COPY locales/ ./locales/ |
| 40 | +COPY spec/ ./spec/ |
| 41 | +COPY task_spec/ ./task_spec/ |
| 42 | +COPY tasks/ ./tasks/ |
| 43 | +COPY templates/ ./templates |
| 44 | +COPY types/ ./types/ |
| 45 | +COPY Gemfile Gemfile.lock Rakefile ./ |
| 46 | +COPY lib/ ./lib/ |
| 47 | +COPY manifests/ ./manifests/ |
| 48 | + |
| 49 | +# Perform the install. |
| 50 | +ENTRYPOINT ["/tmp/bin/run-install.sh"] |
0 commit comments