-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent_Dockerfile
56 lines (48 loc) · 1.96 KB
/
agent_Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
##
# Jenkins SSH Agent.
##
FROM jenkins/ssh-slave:jdk11 as ssh-agent
ENV JENKINS_SLAVE_SSH_PUBKEY=${JENKINS_SLAVE_SSH_PUBKEY}
ENV JENKINS_AGENT_HOME=/var/jenkins_home
## Install docker on the agent
RUN curl -sSL https://get.docker.com/ | sh
## PHP
RUN apt-get --allow-releaseinfo-change update \
&& apt-get -y --no-install-recommends install \
php-cli
## Composer.
RUN EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" && \
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; \
then >&2 echo 'ERROR: Invalid installer checksum' ; \
rm composer-setup.php; exit 1; \
fi && \
php composer-setup.php --quiet && \
rm composer-setup.php && \
mv composer.phar /usr/local/bin/composer && \
chmod +x /usr/local/bin/composer && \
ls -l /usr/local/bin/
## PHP + rsync for blt/robo, make to run commands from Makefile, vim because is great :).
RUN apt-get --allow-releaseinfo-change update \
&& apt-get -y --no-install-recommends install \
php-xml \
php-curl \
php-mbstring \
build-essential \
rsync \
vim \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
USER jenkins
# Git username and email are required by Acquia to be able to push to their repo.
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "jenkins"
### We add the Acquia (Dev) host key to the known hosts.
#RUN mkdir -p /home/jenkins/.ssh \
# # We add dev server pub key to Jenkins known_hosts.
# && ssh-keyscan -H svn-2398.enterprise-g1.hosting.acquia.com >> /home/jenkins/.ssh/known_hosts
USER root
COPY agent-entrypoint /usr/local/bin/agent-entrypoint
RUN chmod +x /usr/local/bin/agent-entrypoint
#EXPOSE 22
ENTRYPOINT ["/bin/bash","-c","/usr/local/bin/agent-entrypoint"]