Last active
July 24, 2019 16:53
-
-
Save rplevka/2cae6e46d37f0ae26530136f7a2debb5 to your computer and use it in GitHub Desktop.
jenkins-slave-fedora-python37
This file contains hidden or 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 fedora:latest | |
| MAINTAINER http://fedoraproject.org/wiki/Cloud | |
| ARG ssh_prv_key | |
| ENV PYCURL_SSL_LIBRARY=openssl | |
| RUN dnf -d10 -y update && dnf clean all | |
| RUN dnf -d10 -y install java-1.8.0-openjdk \ | |
| openssh-server \ | |
| git \ | |
| gcc \ | |
| nc \ | |
| redhat-rpm-config \ | |
| openssl-devel \ | |
| python3-devel \ | |
| libcurl-devel \ | |
| libxml2-devel \ | |
| && dnf clean all | |
| RUN dnf -y install which make | |
| RUN ln -s /usr/bin/pip3 /usr/bin/pip | |
| RUN ln -s /usr/bin/python3.7 /usr/bin/python3.6 | |
| RUN ssh-keygen -A | |
| RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd | |
| RUN mkdir -p /var/run/sshd | |
| RUN useradd jenkins | |
| RUN echo "jenkins:jenkins" | chpasswd | |
| RUN mkdir -p /home/jenkins/.ssh && \ | |
| mkdir -p /root/.ssh && \ | |
| chmod 0700 /home/jenkins/.ssh && \ | |
| chmod 0700 /root/.ssh && \ | |
| echo "$ssh_prv_key" > /home/jenkins/.ssh/id_rsa && \ | |
| chmod 600 /home/jenkins/.ssh/id_rsa && \ | |
| chown -R jenkins /home/jenkins/.ssh && \ | |
| echo "$ssh_prv_key" > /root/.ssh/id_rsa && \ | |
| chmod 600 /root/.ssh/id_rsa && \ | |
| echo "IdentityFile /home/jenkins/.ssh/id_rsa" >> /etc/ssh/ssh_config && \ | |
| echo "eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa" >> ~jenkins/.bash_profile && \ | |
| eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa | |
| EXPOSE 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment