-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
31 lines (26 loc) · 1.05 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
FROM python:3.7-slim-buster
LABEL maintainer "Chebrolu Harika <[email protected]>"
WORKDIR /root
# Some optional but recommended packages
RUN DEBAIN_FRONTEND=noninteractive \
apt-get update -y \
&& apt-get install --no-install-recommends -y \
vim \
curl \
&& pip install ansible hpeOneView hpICsp
# Adding hosts for convenience
RUN mkdir -p /etc/ansible
RUN echo [localhost] >> /etc/ansible/hosts
RUN echo localhost ansible_python_interpreter=python3 ansible_connection=local >> /etc/ansible/hosts
ADD . oneview-ansible-collection/
WORKDIR /root/oneview-ansible-collection
# Building and Installing hpe.oneview collection
RUN ansible-galaxy collection build --force .
RUN ansible-galaxy collection install *.tar.gz
WORKDIR /root/.ansible/collections/ansible_collections/hpe/oneview
# Clean and remove not required packages
RUN DEBAIN_FRONTEND=noninteractive \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf /var/cache/apt/archives/* /var/cache/apt/lists* /tmp/* /root/cache/.
CMD ["ansible-playbook", "--version"]