I have a Docker container like
FROM python:3.6-alpine
ARG BUILD_DEPS=".build-deps"
COPY . /src/
RUN apk add --no-cache --update --virtual ${BUILD_DEPS} \
build-base \
musl-dev \
libffi-dev \
python3-dev \
openssl-dev \
openssh-client \
&& pip3 install /src/requirements.txt \
&& apk del ${BUILD_DEPS}
I noticed that python-3
Step 12/16 : RUN apk add --no-cache --update --virtual ${BUILD_DEPS} build-base musl-dev libffi-dev python3-dev openssl-dev openssh-client && pip install /src/requirements.txt && apk del ${BUILD_DEPS}
---> Running in c06398b186e8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
[ . . . ]
(30/37) Installing python3 (3.6.8-r1)
(31/37) Installing python3-dev (3.6.8-r1)
[ . . . ]
It's installing python3 again and I'm concerned that the wrong headers might be being used when building. There is a chance the docker image python:3.6-alpine will be different from python3-dev and the headers might be incompatible. It's a super small chance but I wouldn't want a surprise later.
Hope someone can shed some light on if the container has the headers already squirreled away somewhere.
You are correct that the ones from Alpine would possibly be incompatible at some point. It looks like the make install did the right thing:
$ docker run -it --rm python:3.6-alpine ls -l /usr/local/include/python3.6m/
total 804
-rw-r--r-- 1 root root 22274 Mar 19 20:21 Python-ast.h
-rw-r--r-- 1 root root 3221 Mar 19 20:21 Python.h
-rw-r--r-- 1 root root 47451 Mar 19 20:21 abstract.h
-rw-r--r-- 1 root root 1016 Mar 19 20:21 accu.h
-rw-r--r-- 1 root root 1213 Mar 19 20:21 asdl.h
-rw-r--r-- 1 root root 477 Mar 19 20:21 ast.h
-rw-r--r-- 1 root root 792 Mar 19 20:21 bitset.h
-rw-r--r-- 1 root root 264 Mar 19 20:21 bltinmodule.h
-rw-r--r-- 1 root root 886 Mar 19 20:21 boolobject.h
-rw-r--r-- 1 root root 2114 Mar 19 20:21 bytearrayobject.h
-rw-r--r-- 1 root root 3191 Mar 19 20:21 bytes_methods.h
-rw-r--r-- 1 root root 8363 Mar 19 20:21 bytesobject.h
-rw-r--r-- 1 root root 701 Mar 19 20:21 cellobject.h
-rw-r--r-- 1 root root 8524 Mar 19 20:21 ceval.h
-rw-r--r-- 1 root root 1666 Mar 19 20:21 classobject.h
-rw-r--r-- 1 root root 5945 Mar 19 20:21 code.h
-rw-r--r-- 1 root root 6793 Mar 19 20:21 codecs.h
-rw-r--r-- 1 root root 2164 Mar 19 20:21 compile.h
-rw-r--r-- 1 root root 1807 Mar 19 20:21 complexobject.h
-rw-r--r-- 1 root root 9414 Mar 19 20:21 datetime.h
-rw-r--r-- 1 root root 2964 Mar 19 20:21 descrobject.h
-rw-r--r-- 1 root root 7178 Mar 19 20:21 dictobject.h
-rw-r--r-- 1 root root 458 Mar 19 20:21 dtoa.h
-rw-r--r-- 1 root root 22469 Mar 19 20:21 dynamic_annotations.h
-rw-r--r-- 1 root root 253 Mar 19 20:21 enumobject.h
-rw-r--r-- 1 root root 1497 Mar 19 20:21 errcode.h
-rw-r--r-- 1 root root 597 Mar 19 20:21 eval.h
-rw-r--r-- 1 root root 1651 Mar 19 20:21 fileobject.h
-rw-r--r-- 1 root root 3524 Mar 19 20:21 fileutils.h
-rw-r--r-- 1 root root 4794 Mar 19 20:21 floatobject.h
-rw-r--r-- 1 root root 3530 Mar 19 20:21 frameobject.h
-rw-r--r-- 1 root root 4079 Mar 19 20:21 funcobject.h
-rw-r--r-- 1 root root 3583 Mar 19 20:21 genobject.h
-rw-r--r-- 1 root root 1966 Mar 19 20:21 graminit.h
-rw-r--r-- 1 root root 2074 Mar 19 20:21 grammar.h
-rw-r--r-- 1 root root 4233 Mar 19 20:21 import.h
-rw-r--r-- 1 root root 513 Mar 19 20:21 intrcheck.h
-rw-r--r-- 1 root root 567 Mar 19 20:21 iterobject.h
-rw-r--r-- 1 root root 2900 Mar 19 20:21 listobject.h
-rw-r--r-- 1 root root 3761 Mar 19 20:21 longintrepr.h
-rw-r--r-- 1 root root 8471 Mar 19 20:21 longobject.h
-rw-r--r-- 1 root root 803 Mar 19 20:21 marshal.h
-rw-r--r-- 1 root root 2765 Mar 19 20:21 memoryobject.h
-rw-r--r-- 1 root root 253 Mar 19 20:21 metagrammar.h
-rw-r--r-- 1 root root 3847 Mar 19 20:21 methodobject.h
-rw-r--r-- 1 root root 7317 Mar 19 20:21 modsupport.h
-rw-r--r-- 1 root root 2285 Mar 19 20:21 moduleobject.h
-rw-r--r-- 1 root root 349 Mar 19 20:21 namespaceobject.h
-rw-r--r-- 1 root root 1007 Mar 19 20:21 node.h
-rw-r--r-- 1 root root 40373 Mar 19 20:21 object.h
-rw-r--r-- 1 root root 14244 Mar 19 20:21 objimpl.h
-rw-r--r-- 1 root root 1288 Mar 19 20:21 odictobject.h
-rw-r--r-- 1 root root 5073 Mar 19 20:21 opcode.h
-rw-r--r-- 1 root root 691 Mar 19 20:21 osdefs.h
-rw-r--r-- 1 root root 291 Mar 19 20:21 osmodule.h
-rw-r--r-- 1 root root 2885 Mar 19 20:21 parsetok.h
-rw-r--r-- 1 root root 1128 Mar 19 20:21 patchlevel.h
-rw-r--r-- 1 root root 253 Mar 19 20:21 pgen.h
-rw-r--r-- 1 root root 1180 Mar 19 20:21 pgenheaders.h
-rw-r--r-- 1 root root 4307 Mar 19 20:21 py_curses.h
-rw-r--r-- 1 root root 2744 Mar 19 20:21 pyarena.h
-rw-r--r-- 1 root root 8128 Mar 19 20:21 pyatomic.h
-rw-r--r-- 1 root root 1726 Mar 19 20:21 pycapsule.h
-rw-r--r-- 1 root root 44054 Mar 19 20:21 pyconfig.h
-rw-r--r-- 1 root root 1320 Mar 19 20:21 pyctype.h
-rw-r--r-- 1 root root 1209 Mar 19 20:21 pydebug.h
-rw-r--r-- 1 root root 1970 Mar 19 20:21 pydtrace.h
-rw-r--r-- 1 root root 17219 Mar 19 20:21 pyerrors.h
-rw-r--r-- 1 root root 2450 Mar 19 20:21 pyexpat.h
-rw-r--r-- 1 root root 8471 Mar 19 20:21 pyfpe.h
-rw-r--r-- 1 root root 410 Mar 19 20:21 pygetopt.h
-rw-r--r-- 1 root root 4139 Mar 19 20:21 pyhash.h
-rw-r--r-- 1 root root 4078 Mar 19 20:21 pylifecycle.h
-rw-r--r-- 1 root root 2989 Mar 19 20:21 pymacconfig.h
-rw-r--r-- 1 root root 3500 Mar 19 20:21 pymacro.h
-rw-r--r-- 1 root root 8312 Mar 19 20:21 pymath.h
-rw-r--r-- 1 root root 8557 Mar 19 20:21 pymem.h
-rw-r--r-- 1 root root 27573 Mar 19 20:21 pyport.h
-rw-r--r-- 1 root root 11146 Mar 19 20:21 pystate.h
-rw-r--r-- 1 root root 436 Mar 19 20:21 pystrcmp.h
-rw-r--r-- 1 root root 495 Mar 19 20:21 pystrhex.h
-rw-r--r-- 1 root root 1483 Mar 19 20:21 pystrtod.h
-rw-r--r-- 1 root root 6782 Mar 19 20:21 pythonrun.h
-rw-r--r-- 1 root root 2992 Mar 19 20:21 pythread.h
-rw-r--r-- 1 root root 7609 Mar 19 20:21 pytime.h
-rw-r--r-- 1 root root 629 Mar 19 20:21 rangeobject.h
-rw-r--r-- 1 root root 3333 Mar 19 20:21 setobject.h
-rw-r--r-- 1 root root 2485 Mar 19 20:21 sliceobject.h
-rw-r--r-- 1 root root 2018 Mar 19 20:21 structmember.h
-rw-r--r-- 1 root root 1353 Mar 19 20:21 structseq.h
-rw-r--r-- 1 root root 4994 Mar 19 20:21 symtable.h
-rw-r--r-- 1 root root 1355 Mar 19 20:21 sysmodule.h
-rw-r--r-- 1 root root 1943 Mar 19 20:21 token.h
-rw-r--r-- 1 root root 3644 Mar 19 20:21 traceback.h
-rw-r--r-- 1 root root 2444 Mar 19 20:21 tupleobject.h
-rw-r--r-- 1 root root 2253 Mar 19 20:21 typeslots.h
-rw-r--r-- 1 root root 1056 Mar 19 20:21 ucnhash.h
-rw-r--r-- 1 root root 81779 Mar 19 20:21 unicodeobject.h
-rw-r--r-- 1 root root 1693 Mar 19 20:21 warnings.h
-rw-r--r-- 1 root root 2866 Mar 19 20:21 weakrefobject.h
@yosifkit Awesome I'll make sure my native deps compile using those headers. Thanks so much!
Most helpful comment
You are correct that the ones from Alpine would possibly be incompatible at some point. It looks like the
make installdid the right thing: