Skip to content

Commit

Permalink
Take advantage of multi files COPY to simplify Dockerfile
Browse files Browse the repository at this point in the history
Move scripts under scripts dir and config files under config dir,
then copy everything at the same time when possible.
Also no need to specify ./ with COPY, the default path is always
in the source dir.
  • Loading branch information
elfosardo committed Jan 12, 2021
1 parent aa1ab28 commit 8961360
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,17 @@ COPY --from=builder /tmp/ipxe/src/bin/undionly.kpxe /tmp/ipxe/src/bin-x86_64-efi

COPY --from=builder /tmp/esp.img /tmp/uefi_esp.img

COPY ./ironic.conf.j2 /etc/ironic/ironic.conf.j2
COPY config/ironic.conf.j2 /etc/ironic/

COPY ./runironic-api.sh /bin/runironic-api
COPY ./runironic-conductor.sh /bin/runironic-conductor
COPY ./runironic-exporter.sh /bin/runironic-exporter
COPY ./rundnsmasq.sh /bin/rundnsmasq
COPY ./runhttpd.sh /bin/runhttpd
COPY ./runmariadb.sh /bin/runmariadb
COPY ./configure-ironic.sh /bin/configure-ironic.sh
COPY ./ironic-common.sh /bin/ironic-common.sh
COPY ./runlogwatch.sh /bin/runlogwatch.sh

# TODO(dtantsur): remove this script when we stop supporting running both
# API and conductor processes via one entry point.
COPY ./runironic.sh /bin/runironic

COPY ./dnsmasq.conf.j2 /etc/dnsmasq.conf.j2
COPY ./inspector.ipxe.j2 /tmp/inspector.ipxe.j2
COPY ./dualboot.ipxe /tmp/dualboot.ipxe
# TODO(dtantsur): remove scripts/runironic script when we stop supporting
# running both API and conductor processes via one entry point.
COPY scripts/ /bin/
COPY config/dnsmasq.conf.j2 /etc/
COPY config/inspector.ipxe.j2 config/dualboot.ipxe /tmp/

# Custom httpd config, removes all but the bare minimum needed modules
RUN rm -f /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.modules.d/*.conf
COPY ./httpd.conf /etc/httpd/conf.d/httpd.conf
COPY ./httpd-modules.conf /etc/httpd/conf.modules.d/httpd-modules.conf
COPY config/httpd.conf /etc/httpd/conf.d/
COPY config/httpd-modules.conf /etc/httpd/conf.modules.d/

ENTRYPOINT ["/bin/runironic"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8961360

Please sign in to comment.