-
Notifications
You must be signed in to change notification settings - Fork 158
/
Dockerfile
35 lines (25 loc) · 1011 Bytes
/
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
FROM python:3.12-alpine
LABEL net.juniper.image.maintainer="Juniper Networks <[email protected]>" \
net.juniper.image.description="Lightweight image with Ansible and the Junos roles"
WORKDIR /tmp
## Copy project inside the containers
ADD requirements.txt .
ADD entrypoint.sh /usr/local/bin/.
## Install dependencies and PyEZ
RUN apk add --no-cache build-base python3-dev py3-pip \
libxslt-dev libxml2-dev libffi-dev openssl-dev curl \
ca-certificates py3-pip bash openssh-client
RUN pip install --upgrade pip \
&& python3 -m pip install -r requirements.txt
# Also install the collections juniper.device
# Install Ansible modules in one layer
RUN ansible-galaxy collection install juniper.device
## Clean up and start init
RUN apk del -r --purge gcc make g++ \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* \
&& rm -rf /root/.cache \
&& chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /project
VOLUME /project
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]