-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CE-351]Add ansible agent image to docker hub
Change-Id: I3b0448a91e29f8e996a49a7b3db58635b30f9b52 Signed-off-by: Tong Li <litong01@us.ibm.com>
- Loading branch information
Tong Li
committed
May 8, 2018
1 parent
e206242
commit e9ce9b7
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Dockerfile for hyperledger cello ansible agent | ||
# | ||
# @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md | ||
# | ||
FROM alpine/git AS BUILD | ||
|
||
RUN cd /tmp && git init cello && cd cello && \ | ||
git remote add origin https://github.com/hyperledger/cello.git && \ | ||
git config core.sparsecheckout true && \ | ||
echo "src/agent/ansible/*" >> .git/info/sparse-checkout && \ | ||
git pull --depth=1 origin master | ||
|
||
FROM ubuntu:xenial | ||
|
||
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 sshpass python-pip openssh-client && \ | ||
pip install --upgrade pip ansible boto boto3 shade \ | ||
pyyaml openshift && \ | ||
groupadd -g ${gid} ${user} && \ | ||
useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \ | ||
usermod -a -G root ${user} && \ | ||
mkdir -p /opt/agent/.ssh && \ | ||
cd /opt/agent/.ssh && \ | ||
echo "host *" > config && \ | ||
echo " StrictHostKeyChecking no" >> config && \ | ||
echo " UserKnownHostsFile /dev/null" >> config | ||
|
||
COPY --from=build /tmp/cello/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" ] |