forked from rundeck-plugins/ansible-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (41 loc) · 1.95 KB
/
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
# Ubuntu 16.04 based, runs as rundeck user
# https://hub.docker.com/r/rundeck/rundeck/tags
ARG RUNDECK_IMAGE
FROM ${RUNDECK_IMAGE}
MAINTAINER Rundeck Team
ENV ANSIBLE_HOST_KEY_CHECKING=false
ENV RDECK_BASE=/home/rundeck
ENV MANPATH=${MANPATH}:${RDECK_BASE}/docs/man
ENV PATH=${PATH}:${RDECK_BASE}/tools/bin
ENV PROJECT_BASE=${RDECK_BASE}/projects/Test-Project
# mkdir -p /etc/ansible \
# ${PROJECT_BASE}/acls \
# install ansible
# base image already installed: curl, openjdk-8-jdk-headless, ssh-client, sudo, uuid-runtime, wget
# (see https://github.com/rundeck/rundeck/blob/master/docker/ubuntu-base/Dockerfile)
RUN sudo apt-get -y update \
&& sudo apt-get -y --no-install-recommends install ca-certificates python3-pip python3-setuptools \
python3-venv sshpass zip unzip \
# https://pypi.org/project/ansible/#history
&& sudo -H pip3 install --upgrade pip==20.3.4 \
&& sudo -H pip3 --no-cache-dir install ansible==2.9.22 \
&& sudo rm -rf /var/lib/apt/lists/* \
&& mkdir -p ${PROJECT_BASE}/etc/ \
&& sudo mkdir /etc/ansible
# install ansible 2.10 in a virtualenv
RUN mkdir -p $HOME/.venv \
&& python3 -m venv $HOME/.venv/ansible-2.10 \
&& source $HOME/.venv/ansible-2.10/bin/activate \
&& pip install --upgrade pip==20.3.4 \
&& pip install ansible==2.10.1
# add default project
COPY --chown=rundeck:rundeck docker/project.properties ${PROJECT_BASE}/etc/
COPY --chown=rundeck:rundeck docker/project.properties ${PROJECT_BASE}/etc/
# remove embedded rundeck-ansible-plugin
RUN zip -d rundeck.war WEB-INF/rundeck/plugins/ansible-plugin-* \
&& unzip -C rundeck.war WEB-INF/rundeck/plugins/manifest.properties \
&& sed -i "s/\(.*\)\(ansible-plugin-.*\.jar,\)\(.*\)/\1\3/" WEB-INF/rundeck/plugins/manifest.properties \
&& zip -u rundeck.war WEB-INF/rundeck/plugins/manifest.properties \
&& rm WEB-INF/rundeck/plugins/manifest.properties
# add locally built ansible plugin
COPY --chown=rundeck:rundeck build/libs/ansible-plugin-*.jar ${RDECK_BASE}/libext/