blob: 8e3d6b9de181b62bb5fa5072364dd19b7e639fa9 (
plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# onap-python
This Dockerfile aims to generate a baseline image for ONAP [1] projects
based on SECCOM recommendations [2].
It includes:
- python 3.9
- pip3
## History
### 8.0.0
use Python 3.9 and alpine 3.12
### 7.0.1
Evolution of 7.0.0 without the ONBUILD constraint
This directive was leading to issue when some packages had to be installed
to build python lib dependencies
### 7.0.0
version including ONBUILD directive
Due to the ONBUILD directive, each project must provide a requirements.txt file
before building an image derived from this baseline image.
Without this requirements.txt file, the docker built will fail.
The pip install -r requirements.txt will be executed on the build of your image.
An example of Dockerfile consuming this base line image could be:
```
FROM nexus3.onap.org:10001/onap/integration-python
RUN echo "Add your specifc docker needs here."
```
Note if you need to specific package to build python library, it is possible.
You need to use root user temporarily as described hereafter.
ONBUILD directives will be called after the root section, allowing you to install
the system packages you need to execute your pip install -rrequirements.txt.
```
FROM nexus3.onap.org:10001/onap/integration-python:7.0.0
USER root
# Needed for pycurl
# Install packages only needed for building
RUN apk update && \
apk add binutils jq libpng && \
apk add --no-cache --virtual .build-dependencies \
libressl-dev && \
apk del .build-dependencies
# user/group are the same as in integration/docker/onap-python base image
ENV user=onap group=onap
USER $user
```
Please note that you are responsible of the licenses of the packages you are adding.
Only the baseline image is GPLv3 free.
For example be aware that bash is GPLv3.
See SDC full example in [3].
[1]: http://wiki.onap.org
[2]: https://git.onap.org/integration/seccom/tree/recommended_versions.yaml?h=honolulu
[3]: https://gerrit.onap.org/r/gitweb?p=sdc/sdc-docker-base.git;a=blob;f=base_sdc-python/Dockerfile;h=57daaa9621e1af122b7c5941f3733db743bbe6d5;hb=0e0dff07cf70588ef270e12e5ec43805c12daa4d
|