forked from autofald/network-as-code-training-101
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab-mgmt.dockerfile
44 lines (38 loc) · 1.15 KB
/
lab-mgmt.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
# pull base image
FROM alpine:3.18
ARG ANSIBLE_CORE_VERSION=2.16.4
ARG ANSIBLE_VERSION=9.3.0
ARG GNMIC_VERSION=0.36.2
ENV ANSIBLE_CORE_VERSION ${ANSIBLE_CORE_VERSION}
ENV ANSIBLE_VERSION ${ANSIBLE_VERSION}
RUN apk --no-cache add \
sudo \
python3\
py3-pip \
openssl \
ca-certificates \
sshpass \
openssh-client \
rsync \
git && \
apk --no-cache add --virtual build-dependencies \
python3-dev \
libffi-dev \
musl-dev \
gcc \
build-base && \
pip3 install --upgrade pip wheel && \
pip3 install --upgrade cryptography cffi && \
pip3 install ansible-core==${ANSIBLE_CORE_VERSION} && \
pip3 install ansible==${ANSIBLE_VERSION} && \
pip3 install jxmlease paramiko ncclient jmespath xmltodict && \
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/pip
RUN pip3 install netutils
RUN mkdir /workdir && \
mkdir -p /etc/ansible && \
echo 'localhost' > /etc/ansible/hosts && \
ansible-galaxy collection install networktocode.nautobot
WORKDIR /workdir
CMD [ "ansible-playbook", "--version" ]