-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.dockerfile.jinja2
59 lines (42 loc) · 2.2 KB
/
base.dockerfile.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{% embed "dockerfile/base.jinja2" %}
FROM base as dev
{% embed "dockerfile/dev.jinja2" %}
{% embed "dockerfile/init.jinja2" %}
{% embed "dockerfile/ruby.jinja2" %}
{% embed "dockerfile/boost.jinja2" %}
{% embed "dockerfile/yaml-cpp.jinja2" %}
{% embed "dockerfile/leatherman.jinja2" %}
{% embed "dockerfile/cpp-hocon.jinja2" %}
{% embed "dockerfile/facter.jinja2" %}
{% embed "dockerfile/puppet.jinja2" %}
FROM dev as prepare
COPY --from=dev_init "{{ install_dir }}" "{{ install_dir }}"
COPY --from=dev_puppet "{{ install_dir }}" "{{ install_dir }}"
{% block dev_build_post %}
RUN find /opt/puppetizer/ -iname "*.a" -delete \
&& find /opt/puppetizer/ -iname "*.so" -type f -exec strip -ps {} \; \
&& find /opt/puppetizer/ \( -name "*.so" -or -perm +{% if system == "alpine" %}0001{% else %}x{% endif %} \) -type f -exec strip -psv {} 2> /dev/null \;
RUN rm -rf /opt/puppetizer/include /opt/puppetizer/share/man /opt/puppetizer/lib/ruby/gems/*/cache/
{% endblock %}
FROM base as local
ADD ./opt /opt/puppetizer/
RUN sed -i /opt/puppetizer/share/common.sh \
-e 's@%PUPPETIZER_PKG_CLEANUP%@{{ packages_cmd_clean|default(':')|replace('&', '\&') }}@g' \
-e 's@%PUPPETIZER_PKG_INIT%@{{ packages_cmd_init|default(':')|replace('&', '\&') }}@g' \
-e 's@%PUPPETIZER_PKG_INSTALL%@{{ packages_cmd_install|replace('&', '\&') }}@g'
ADD ./puppet /opt/puppetizer/puppet/modules-internal/puppetizer
FROM base
LABEL \
org.opencontainers.image.authors="Arkadiusz Dzięgiel <[email protected]>" \
org.opencontainers.image.url="https://github.com/glorpen/docker-puppetizer-base" \
org.opencontainers.image.documentation="https://github.com/glorpen/docker-puppetizer-base" \
org.opencontainers.image.source="https://github.com/glorpen/docker-puppetizer-base" \
org.opencontainers.image.title="Puppetizer" \
org.opencontainers.image.description="Base for images configured by Puppet"
COPY --from=prepare "{{ install_dir }}" "{{ install_dir }}"
COPY --from=local "{{ install_dir }}" "{{ install_dir }}"
HEALTHCHECK CMD ["/opt/puppetizer/bin/health"]
CMD ["/opt/puppetizer/bin/init"]
LABEL \
org.opencontainers.image.created="{{ now.isoformat() }}" \
org.opencontainers.image.version="{{ version }}"