fnproject / dockers

Docker base images for various programming languages.
https://fnproject.github.io/
35 stars 10 forks source link

fnproject/python3.6 misses gcc complier #3

Open denismakogon opened 6 years ago

treeder commented 6 years ago

I assume #4 closes this?

denismakogon commented 6 years ago

yes.

denismakogon commented 6 years ago

Starts happening again.

FN_REGISTRY=denismakogon fn -v run
Building image denismakogon/test:0.0.1 
Sending build context to Docker daemon   5.12kB
Step 1/6 : FROM fnproject/python:3.6
 ---> f0646bdacb87
Step 2/6 : WORKDIR /function
 ---> Using cache
 ---> 9f6fe5ae51ea
Step 3/6 : ADD requirements.txt /function/
 ---> Using cache
 ---> 5b4f41056385
Step 4/6 : RUN pip3 install -r requirements.txt
 ---> Running in 75622d970ace
Collecting fdk==0.0.5 (from -r requirements.txt (line 1))
  Downloading fdk-0.0.5-py2.py3-none-any.whl
Collecting iso8601==0.1.12 (from fdk==0.0.5->-r requirements.txt (line 1))
  Downloading iso8601-0.1.12-py3-none-any.whl
Collecting ujson==1.35 (from fdk==0.0.5->-r requirements.txt (line 1))
  Downloading ujson-1.35.tar.gz (192kB)
Collecting pbr!=2.1.0,>=2.0.0 (from fdk==0.0.5->-r requirements.txt (line 1))
  Downloading pbr-3.1.1-py2.py3-none-any.whl (99kB)
Collecting dill==0.2.7.1 (from fdk==0.0.5->-r requirements.txt (line 1))
  Downloading dill-0.2.7.1.tar.gz (64kB)
Collecting requests==2.18.4 (from fdk==0.0.5->-r requirements.txt (line 1))
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting idna<2.7,>=2.5 (from requests==2.18.4->fdk==0.0.5->-r requirements.txt (line 1))
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
Collecting urllib3<1.23,>=1.21.1 (from requests==2.18.4->fdk==0.0.5->-r requirements.txt (line 1))
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
Collecting certifi>=2017.4.17 (from requests==2.18.4->fdk==0.0.5->-r requirements.txt (line 1))
  Downloading certifi-2017.11.5-py2.py3-none-any.whl (330kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests==2.18.4->fdk==0.0.5->-r requirements.txt (line 1))
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
Installing collected packages: iso8601, ujson, pbr, dill, idna, urllib3, certifi, chardet, requests, fdk
  Running setup.py install for ujson: started
    Running setup.py install for ujson: finished with status 'error'
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ywylho00/ujson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-u3jc4edr-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'ujson' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/python
    creating build/temp.linux-x86_64-3.6/lib
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./python -I./lib -I/usr/include/python3.6m -c ./python/ujson.c -o build/temp.linux-x86_64-3.6/./python/ujson.o -D_GNU_SOURCE
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ywylho00/ujson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-u3jc4edr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ywylho00/ujson/
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1

Error during build. Run with `--verbose` flag to see what went wrong. eg: `fn --verbose CMD`
ERROR: error running docker build: exit status 1
treeder commented 6 years ago

It looks like it's not using the dev image to build. I guess python isn't doing the multi-stage builds yet?

denismakogon commented 6 years ago

Yeah, python doesn't do multi-stage builds yet.

denismakogon commented 6 years ago

So, what would be the short-term solution:

  1. Let CLI use fnproject/python:3.6-dev?
  2. Make Python run multi-stage builds?
  3. Leave as is since we can override build image?
treeder commented 6 years ago

Ok, well easy fix is to change it to fnproject/python:3.6-dev.

treeder commented 6 years ago

Posted at the same time.

2 is best option if it can work with python.