Created
March 22, 2019 05:26
-
-
Save jbauers/dc2b9c3caa5e18327eb775bff25cac84 to your computer and use it in GitHub Desktop.
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
FROM alpine:latest | |
# Sudo to emulate OS behavior | |
RUN apk --update add ca-certificates \ | |
openssl \ | |
sudo | |
RUN apk --update add --virtual build-dependencies \ | |
python3-dev \ | |
libffi-dev \ | |
openssl-dev \ | |
build-base | |
RUN apk add --no-cache python3 && \ | |
python3 -m ensurepip && \ | |
rm -r /usr/lib/python*/ensurepip && \ | |
pip3 install --upgrade pip setuptools && \ | |
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ | |
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ | |
rm -r /root/.cache | |
# Ansible with Docker support | |
RUN pip3 install --upgrade ansible | |
RUN pip3 install --upgrade pycrypto \ | |
pywinrm | |
# https://github.com/ansible/ansible/issues/20492 | |
RUN pip3 uninstall docker | |
RUN pip3 uninstall docker-compose | |
RUN pip3 uninstall docker-py | |
RUN pip3 install docker==3.7.1 && \ | |
# https://github.com/paramiko/paramiko/issues/1369#issuecomment-456940895 | |
pip3 install cryptography==2.4.2 | |
RUN apk --update add --no-cache rsync | |
RUN apk del build-dependencies && \ | |
rm -rf /var/cache/apk/* | |
RUN mkdir -p /root/.ssh && \ | |
echo "Host *" > /root/.ssh/config && \ | |
echo " IdentityFile /root/.ssh/id_rsa" >> /root/.ssh/config | |
RUN mkdir /ansible | |
WORKDIR /ansible | |
CMD [ "ansible", "--version"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment