aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Copeland <ben.copeland@linaro.org>2018-07-30 16:45:19 +0100
committerBenjamin Copeland <ben.copeland@linaro.org>2018-07-30 16:47:57 +0100
commit9d49a21ab5c8424fa8a7e567a3a2c99dcd3b20c2 (patch)
tree884642fc7af8c87b776b9dbd524dcc38e19323b8
parentaf738567c406cf9a17f86812a87d0c811be1bd79 (diff)
Docker: Build our docker base image with ssh-ldap role
This kinda replaces the useful setup-ssh.sh script. It deploys xenial and deploys ssh-ldap role allowing for a docker image to built and being able to ssh in with first.last@linaro.org Change-Id: I50d0d3012cec423ef9bc66a46514c1b7cd1dc34d
-rw-r--r--Dockerfile_xenial_ssh31
1 files changed, 31 insertions, 0 deletions
diff --git a/Dockerfile_xenial_ssh b/Dockerfile_xenial_ssh
new file mode 100644
index 0000000..bda2c5d
--- /dev/null
+++ b/Dockerfile_xenial_ssh
@@ -0,0 +1,31 @@
+# Builds ubuntu latest image from docker hub
+# Install and setups ansible
+# Run from ansible dir: "docker build -t ansible_deploy ."
+# You will need to update the playbook you deploy in this file.
+
+FROM ubuntu:16.04
+
+LABEL maintainer="Ben Copeland <ben.copeland@linaro.org>"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install -y software-properties-common python-software-properties
+RUN apt-add-repository -y ppa:ansible/ansible
+
+RUN apt-get update && apt-get install -y ansible vim bash openssh-server python-apt sudo cron git
+
+RUN mkdir -p /root/.ssh/ && mkdir -p /var/run/sshd
+ADD pubkeys /root/.ssh/authorized_keys
+
+# add playbooks/roles to the image.
+
+
+RUN cd /tmp \
+ && git clone https://git.linaro.org/infrastructure/ansible-playbooks \
+ && cd /tmp/ansible-playbooks \
+ && rm secrets \
+ && mkdir -p secrets/group_vars \
+ && echo "ssh_ldap_bindpw: xxxx" >> secrets/group_vars/all \ # fill in password
+ && ansible-playbook -v -c local -i hosts -l android.linaro.org ssh-ldap.yml -e ldap_cache_url="" -e sudo_groups=systems -e login_groups=systems
+
+CMD /usr/sbin/sshd -D