summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-01-27 13:52:36 +0000
committerGerrit Code Review <review@openstack.org>2016-01-27 13:52:36 +0000
commitb6c9d2acfaafb2de0be88ef0f82c963c116a4904 (patch)
treede8baea9e39c1266e3a6b7bc291be63f2f195478 /docker
parentc70cefe19cc3f18b906098a2e2dbc55a7b4dd34d (diff)
parent5855a07212d8f1daba20ab297d9b4f3089d53a39 (diff)
downloadkolla-b6c9d2acfaafb2de0be88ef0f82c963c116a4904.tar.gz
kolla-b6c9d2acfaafb2de0be88ef0f82c963c116a4904.zip
Merge "Add bootstrap task for ironic-pxe"
Diffstat (limited to 'docker')
-rw-r--r--docker/ironic/ironic-pxe/Dockerfile.j211
-rw-r--r--docker/ironic/ironic-pxe/extend_start.sh14
2 files changed, 18 insertions, 7 deletions
diff --git a/docker/ironic/ironic-pxe/Dockerfile.j2 b/docker/ironic/ironic-pxe/Dockerfile.j2
index da2adbe5e..bda9a9bdd 100644
--- a/docker/ironic/ironic-pxe/Dockerfile.j2
+++ b/docker/ironic/ironic-pxe/Dockerfile.j2
@@ -6,9 +6,7 @@ MAINTAINER {{ maintainer }}
RUN yum -y install \
tftp-server \
syslinux-tftpboot \
- && yum clean all \
- && mkdir -p /tftpboot \
- && cp /var/lib/tftpboot/chain.c32 /tftpboot
+ && yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
@@ -16,13 +14,12 @@ RUN apt-get install -y --no-install-recommends \
tftpd-hpa \
syslinux-common \
syslinux \
- && apt-get clean \
- && mkdir -p /tftpboot \
- && chown -R ironic: /tftpboot \
- && cp /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32 /tftpboot
+ && apt-get clean
{% endif %}
COPY tftp-map-file /map-file
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/ironic/ironic-pxe/extend_start.sh b/docker/ironic/ironic-pxe/extend_start.sh
new file mode 100644
index 000000000..0f5fcd679
--- /dev/null
+++ b/docker/ironic/ironic-pxe/extend_start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ chown -R ironic: /tftpboot
+ for pxe_file in /var/lib/tftpboot/chain.c32 /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32; do
+ if [[ -e "$pxe_file" ]]; then
+ cp "$pxe_file" /tftpboot
+ fi
+ done
+ exit 0
+fi
+