Last active
October 29, 2019 11:30
-
-
Save wicksome/4b9b5b818cec4785ae48d1f794e7eec2 to your computer and use it in GitHub Desktop.
Dockerfile: Jenkins with Ansible
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 jenkins/jenkins:latest | |
LABEL maintainer="Yeongjun.kim <[email protected]>" | |
LABEL title="Docker with Ansible" | |
# https://github.com/ansible/ansible/releases | |
ARG ansible_version=2.8.6 | |
USER root | |
RUN echo ${ansible_version} | |
RUN cd /root && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | |
python get-pip.py --user && \ | |
/root/.local/bin/pip install ansible==${ansible_version} && \ | |
mkdir /etc/ansible | |
ENV ANSIBLE_VERSION=${ansible_version} | |
VOLUME ["/etc/ansible"] | |
USER jenkins |
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
#/usr/bin/bash | |
docker-compose pull | |
docker-compose build --no-cache | |
[ $? -ne 0 ] && exit 1; | |
docker-compose down | |
docker-compose up -d | |
docker image prune -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Show ansible/jenkins version
http://<<JENKINS_URL>>/systemInfo
Set ansible
/usr/local/bin/
: http://<JENKINS_URL>/configureTools/