summaryrefslogtreecommitdiff
path: root/docker/tripleoclient
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2018-08-23 14:51:03 -0400
committerDan Prince <dprince@redhat.com>2018-09-06 09:33:57 -0400
commite1b37f5444bae2400490917b697a18b03c90cace (patch)
tree57b90c73b7f4bce80e542b8e1ae78c5ab3bc9acc /docker/tripleoclient
parent966b0b1e38649fb1e71b1004aa356ab36afc2830 (diff)
downloadkolla-e1b37f5444bae2400490917b697a18b03c90cace.tar.gz
kolla-e1b37f5444bae2400490917b697a18b03c90cace.zip
Add a tripleoclient container
We'd like to use this container both interactively (for ad-hoc commands) and also to be able to generate Ansible (via the undercloud/all-in-one installers) for TripleO. Partially-implements: https://blueprints.launchpad.net/tripleo/+spec/zero-footprint Change-Id: Ia4d7fdcb9c96d76e191dcc1a46be095b37189b3e
Diffstat (limited to 'docker/tripleoclient')
-rw-r--r--docker/tripleoclient/Dockerfile.j240
-rw-r--r--docker/tripleoclient/create_super_user.sh18
2 files changed, 58 insertions, 0 deletions
diff --git a/docker/tripleoclient/Dockerfile.j2 b/docker/tripleoclient/Dockerfile.j2
new file mode 100644
index 000000000..37d8defc7
--- /dev/null
+++ b/docker/tripleoclient/Dockerfile.j2
@@ -0,0 +1,40 @@
+FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
+LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+
+{% block tripleoclient_header %}{% endblock %}
+
+{% import "macros.j2" as macros with context %}
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+
+ {% set tripleoclient_packages = [
+ 'python-ipaddr',
+ 'python-openstackclient',
+ 'python-tripleoclient',
+ 'puppet-tripleo',
+ 'openstack-tripleo-validations',
+ 'e2fsprogs',
+ 'xfsprogs',
+ 'openssh-clients',
+ 'git'
+ ] %}
+
+{{ macros.install_packages(tripleoclient_packages | customizable("packages")) }}
+
+ {% else %}
+RUN echo 'tripleoclient not yet available for {{ base_distro }}' && /bin/false
+ {% endif %}
+
+{% elif install_type == 'source' %}
+
+
+RUN echo 'tripleoclient not yet available for {{ base_distro }} source installs' && /bin/false
+
+{% endif %}
+
+COPY create_super_user.sh /usr/local/bin/create_super_user.sh
+RUN chmod 750 /usr/local/bin/create_super_user.sh
+
+{% block tripleoclient_footer %}{% endblock %}
+{% block footer %}{% endblock %}
diff --git a/docker/tripleoclient/create_super_user.sh b/docker/tripleoclient/create_super_user.sh
new file mode 100644
index 000000000..37c8bf1df
--- /dev/null
+++ b/docker/tripleoclient/create_super_user.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# This is a useful entrypoint/cmd if you wish to run commands in a container
+# in an existing users $HOME directory
+# For example: docker run -ti -e USER=stack -e UID=1000 --privileged=true --volume=/home/stack/:/home/stack/ tripleoclient:latest /usr/local/bin/create_super_user.sh
+
+if [ -n "$USER" -a -n "$UID" ]; then
+ useradd "$USER" -u "$UID" -M
+cat >> /etc/sudoers <<EOF_CAT
+$USER ALL=(ALL) NOPASSWD:ALL
+EOF_CAT
+ su -l $USER
+ export TERM="xterm"
+ alias ls='ls --color=auto'
+ /bin/bash
+else
+ echo "Please set valid $USER and $UID env variables."
+ exit 1
+fi