Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

using standard python base image #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

yifanfu
Copy link

@yifanfu yifanfu commented May 3, 2020

Recently the cryptography seems failed to build in apline version of python base image. I have replaced the alpine version of python with the standard (I believe it's Debian based) version of python base image, and all the builds passed.

@freyta
Copy link
Owner

freyta commented May 18, 2020

It seems to work fine on my side. Can anyone else confirms that it doesn't work?

[freyta@freyta-arch 7Eleven-Python]$ docker build -t fuellock .
Sending build context to Docker daemon  761.3kB
Step 1/7 : FROM python:3.7-alpine
3.7-alpine: Pulling from library/python
cbdbe7a5bc2a: Pull complete 
26ebcd19a4e3: Pull complete 
f2a4afa74df8: Pull complete 
a3916b494c8f: Pull complete 
038cfaa9de84: Pull complete 
Digest: sha256:8acbf2568aaf64337a9ef2d4f15e0813566957b93fa6954c165335d1a54ca617
Status: Downloaded newer image for python:3.7-alpine
 ---> 61681f520204
Step 2/7 : RUN apk --update add --no-cache bash tzdata build-base libffi-dev openssl-dev
 ---> Running in 9f5cb993bb7c
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/24) Installing bash (5.0.11-r1)
Executing bash-5.0.11-r1.post-install
(2/24) Installing libgcc (9.2.0-r4)
(3/24) Installing libstdc++ (9.2.0-r4)
(4/24) Installing binutils (2.33.1-r0)
(5/24) Installing libmagic (5.37-r1)
(6/24) Installing file (5.37-r1)
(7/24) Installing gmp (6.1.2-r1)
(8/24) Installing isl (0.18-r0)
(9/24) Installing libgomp (9.2.0-r4)
(10/24) Installing libatomic (9.2.0-r4)
(11/24) Installing mpfr4 (4.0.2-r1)
(12/24) Installing mpc1 (1.1.0-r1)
(13/24) Installing gcc (9.2.0-r4)
(14/24) Installing musl-dev (1.1.24-r2)
(15/24) Installing libc-dev (0.7.2-r0)
(16/24) Installing g++ (9.2.0-r4)
(17/24) Installing make (4.2.1-r2)
(18/24) Installing fortify-headers (1.1-r0)
(19/24) Installing build-base (0.5-r1)
(20/24) Installing linux-headers (4.19.36-r0)
(21/24) Installing pkgconf (1.6.3-r0)
(22/24) Installing libffi-dev (3.2.1-r6)
(23/24) Installing openssl-dev (1.1.1g-r0)
(24/24) Installing tzdata (2020a-r0)
Executing busybox-1.31.1-r9.trigger
OK: 195 MiB in 58 packages
Removing intermediate container 9f5cb993bb7c
 ---> 1399710844f6
Step 3/7 : WORKDIR .
 ---> Running in d94a8bec3938
Removing intermediate container d94a8bec3938
 ---> a16f59a2a1f5
Step 4/7 : COPY requirements.txt ./
 ---> 243667d07267
Step 5/7 : RUN pip install --no-cache-dir -r requirements.txt
 ---> Running in b6b7207389be
Collecting googlemaps==3.0.2
  Downloading googlemaps-3.0.2.tar.gz (24 kB)
Collecting requests==2.20.0
  Downloading requests-2.20.0-py2.py3-none-any.whl (60 kB)
Collecting Flask==1.0.2
  Downloading Flask-1.0.2-py2.py3-none-any.whl (91 kB)
Collecting pytz
  Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
Collecting configparser
  Downloading configparser-5.0.0-py3-none-any.whl (22 kB)
Collecting apscheduler
  Downloading APScheduler-3.6.3-py2.py3-none-any.whl (58 kB)
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.9.1-py3-none-any.whl (115 kB)
Collecting pyOpenSSL==18.0.0
  Downloading pyOpenSSL-18.0.0-py2.py3-none-any.whl (53 kB)
Collecting flask_basicauth
  Downloading Flask-BasicAuth-0.2.0.tar.gz (16 kB)
Collecting pydes
  Downloading pyDes-2.0.1.tar.gz (9.9 kB)
Collecting chardet<3.1.0,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<2.8,>=2.5
  Downloading idna-2.7-py2.py3-none-any.whl (58 kB)
Collecting urllib3<1.25,>=1.21.1
  Downloading urllib3-1.24.3-py2.py3-none-any.whl (118 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
Collecting click>=5.1
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting Jinja2>=2.10
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting itsdangerous>=0.24
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Werkzeug>=0.14
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting six>=1.4.0
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting tzlocal>=1.2
  Downloading tzlocal-2.1-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: setuptools>=0.7 in /usr/local/lib/python3.7/site-packages (from apscheduler->-r requirements.txt (line 6)) (46.1.3)
Collecting soupsieve>1.2
  Downloading soupsieve-2.0.1-py3-none-any.whl (32 kB)
Collecting cryptography>=2.2.1
  Downloading cryptography-2.9.2.tar.gz (517 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Collecting cffi!=1.11.3,>=1.8
  Downloading cffi-1.14.0.tar.gz (463 kB)
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
Building wheels for collected packages: googlemaps, flask-basicauth, pydes, cryptography, MarkupSafe, cffi
  Building wheel for googlemaps (setup.py): started
  Building wheel for googlemaps (setup.py): finished with status 'done'
  Created wheel for googlemaps: filename=googlemaps-3.0.2-py3-none-any.whl size=31703 sha256=c55ad42ef53737d541f604db27e2379aac6d2067df5d9faa9191c37e472a83e4
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/8e/ba/23/5646f434b183c9166a7403a98dbcc888953598c596d2a4c5de
  Building wheel for flask-basicauth (setup.py): started
  Building wheel for flask-basicauth (setup.py): finished with status 'done'
  Created wheel for flask-basicauth: filename=Flask_BasicAuth-0.2.0-py3-none-any.whl size=4227 sha256=f7dd580b905172dc6605959fb4fcfa1d885b9b3f6d42f7a072d6b08505e997a2
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/d5/08/a3/19638d90fdf01258ede772449bcbde424839459749acb977b6
  Building wheel for pydes (setup.py): started
  Building wheel for pydes (setup.py): finished with status 'done'
  Created wheel for pydes: filename=pyDes-2.0.1-py2.py3-none-any.whl size=9548 sha256=2d555cb507b51c990c7d7bcc774c5b880df2a8d64b131785fc800933294d20d8
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/57/45/3a/cd3cffc8044aa6b8670109a57db784cc7c64dc52259a11575a
  Building wheel for cryptography (PEP 517): started
  Building wheel for cryptography (PEP 517): finished with status 'done'
  Created wheel for cryptography: filename=cryptography-2.9.2-cp37-cp37m-linux_x86_64.whl size=1363932 sha256=29f13ea2dacb0b362832634338b4abc1495aff30db951a1105d6b5aa3d8c66be
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/50/3e/fd/7efe561a12acd22a518f4a2ae023e4d8ac9a7d6d3da66d5d21
  Building wheel for MarkupSafe (setup.py): started
  Building wheel for MarkupSafe (setup.py): finished with status 'done'
  Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-cp37-cp37m-linux_x86_64.whl size=36323 sha256=5f3e8938aa0c447caefea3fecfc95bfb87a0325143c9430d46cd6af3453e9204
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/b9/d9/ae/63bf9056b0a22b13ade9f6b9e08187c1bb71c47ef21a8c9924
  Building wheel for cffi (setup.py): started
  Building wheel for cffi (setup.py): finished with status 'done'
  Created wheel for cffi: filename=cffi-1.14.0-cp37-cp37m-linux_x86_64.whl size=429070 sha256=2b32cda3d8918924ad69f24c4b008b6f6fa68d1b529450a635a139b7c368afb2
  Stored in directory: /tmp/pip-ephem-wheel-cache-bhsucfhu/wheels/c4/91/4f/81fe591804590e3cd010d6c54f251607dc4c61fc5eb5840a51
Successfully built googlemaps flask-basicauth pydes cryptography MarkupSafe cffi
Installing collected packages: chardet, idna, urllib3, certifi, requests, googlemaps, click, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask, pytz, configparser, six, tzlocal, apscheduler, soupsieve, beautifulsoup4, pycparser, cffi, cryptography, pyOpenSSL, flask-basicauth, pydes
Successfully installed Flask-1.0.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 apscheduler-3.6.3 beautifulsoup4-4.9.1 certifi-2020.4.5.1 cffi-1.14.0 chardet-3.0.4 click-7.1.2 configparser-5.0.0 cryptography-2.9.2 flask-basicauth-0.2.0 googlemaps-3.0.2 idna-2.7 itsdangerous-1.1.0 pyOpenSSL-18.0.0 pycparser-2.20 pydes-2.0.1 pytz-2020.1 requests-2.20.0 six-1.14.0 soupsieve-2.0.1 tzlocal-2.1 urllib3-1.24.3
Removing intermediate container b6b7207389be
 ---> 173973bf5ee2
Step 6/7 : COPY . .
 ---> 27dac62fa4ae
Step 7/7 : ENTRYPOINT [ "python", "app.py" ]
 ---> Running in fd94ae004b90
Removing intermediate container fd94ae004b90
 ---> af0d321152f2
Successfully built af0d321152f2
Successfully tagged fuellock:latest
[freyta@freyta-arch 7Eleven-Python]$ docker run fuellock
Note: You have not set an API key. You will not be able to use Google to find a stores coordinates.
But you can still use the manual search if you know the postcode to the store you want to lock in from.





Note: You have not set a device ID. A random one will be set when you login.
Note: No stores.json found, creating it for you.
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

@MattKobayashi
Copy link
Contributor

@freyta I'm also finding the Alpine image builds fine. The proposed changes in this PR would dramatically increase the image size. It also fails to link to a specific version of the python base image, which is against Dockerfile best practices as it would make the 7Eleven-Python image susceptible to future changes in the base image that may break it.

@yifanfu Could you please share some more information about what issue you're having with the cryptography build using the Alpine base image?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants