diff options
| author | Zuul <zuul@review.openstack.org> | 2018-09-10 10:32:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-09-10 10:32:17 +0000 |
| commit | bbab10815ceb23993aa29a1743bfe2b3cbd87f6e (patch) | |
| tree | 60808e277e64e1704d8de848efa5e8c3969bfc4d /docker | |
| parent | 451d0fc023c9a167364cfa15cead808f74d9ac67 (diff) | |
| parent | e1b37f5444bae2400490917b697a18b03c90cace (diff) | |
| download | kolla-bbab10815ceb23993aa29a1743bfe2b3cbd87f6e.tar.gz kolla-bbab10815ceb23993aa29a1743bfe2b3cbd87f6e.zip | |
Merge "Add a tripleoclient container"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/tripleoclient/Dockerfile.j2 | 40 | ||||
| -rw-r--r-- | docker/tripleoclient/create_super_user.sh | 18 |
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 |
