123456789101112131415161718192021222324252627282930313233343536373839 |
- # Dockerfile for hyperledger cello ansible agent
- #
- # @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md
- #
- FROM _DOCKER_BASE_
- MAINTAINER Tong Li <litong01@us.ibm.com>
- ARG user=ubuntu
- ARG uid=1000
- ARG gid=1000
- RUN apt-get update && \
- apt-get install -y bash curl python-dev sshpass sudo \
- python-pip build-essential openssh-client libffi-dev \
- libssl-dev && \
- pip install --upgrade pip ansible boto boto3 shade \
- pyyaml && \
- groupadd -g ${gid} ${user} && \
- useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \
- usermod -a -G root ${user} && \
- echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \
- mkdir -p /opt/agent/.ssh && \
- cd /opt/agent/.ssh && \
- echo "host *" > config && \
- echo " StrictHostKeyChecking no" >> config && \
- echo " UserKnownHostsFile /dev/null" >> config
- ADD src/agent/ansible /opt/agent
- RUN ssh-keygen -q -t rsa -N '' -f /opt/agent/vars/fd && \
- chown -R ${uid}:${gid} /opt/agent && \
- chmod 755 /opt/agent/entrypoint.sh
- ENV HOME /opt/agent
- ENV WORKDIR /opt/agent
- WORKDIR /opt/agent
- USER ${user}
- ENTRYPOINT ["/opt/agent/entrypoint.sh"]
- CMD [ "ansible-playbook", "--version" ]
|