| 1 |
FROM python:3.12-alpine |
| 2 |
|
| 3 |
LABEL net.juniper.description="Junos PyEZ library for Python in a lightweight container." \ |
| 4 |
net.juniper.maintainer="[email protected]" |
| 5 |
|
| 6 |
WORKDIR /source |
| 7 |
|
| 8 |
## Copy project inside the containers |
| 9 |
ADD setup.* ./ |
| 10 |
ADD versioneer.py . |
| 11 |
ADD requirements.txt . |
| 12 |
ADD lib lib |
| 13 |
ADD entrypoint.sh /usr/local/bin/. |
| 14 |
|
| 15 |
## Install dependancies and PyEZ |
| 16 |
RUN apk add --no-cache build-base python3-dev \ |
| 17 |
libxslt-dev libxml2-dev libffi-dev openssl-dev curl \ |
| 18 |
ca-certificates py3-pip bash |
| 19 |
|
| 20 |
RUN pip install --upgrade pip \ |
| 21 |
&& pip install pipdeptree \ |
| 22 |
&& python3 -m pip install -r requirements.txt \ |
| 23 |
&& pip install . |
| 24 |
|
| 25 |
## Clean up and start init |
| 26 |
RUN apk del -r --purge gcc make g++ \ |
| 27 |
&& rm -rf /source/* \ |
| 28 |
&& chmod +x /usr/local/bin/entrypoint.sh |
| 29 |
|
| 30 |
WORKDIR /scripts |
| 31 |
|
| 32 |
VOLUME /scripts |
| 33 |
|
| 34 |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |