Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize docker image #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 42 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
FROM alpine:3.5
FROM python:3-alpine

RUN apk add --update-cache py3-pip ca-certificates py3-certifi py3-lxml\
python3-dev cython cython-dev libusb-dev build-base \
eudev-dev linux-headers libffi-dev openssl-dev \
jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev \
tiff-dev tk-dev tcl-dev
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

COPY setup.py README.rst requirements.txt /build/
RUN pip3 install -r /build/requirements.txt

COPY aws_google_auth /build/aws_google_auth
RUN pip3 install -e /build/[u2f]

ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
RUN apk add --update --no-cache \
ca-certificates \
libxml2 \
libxslt \
eudev-libs \
libffi \
openssl \
jpeg \
zlib \
freetype \
lcms2 \
openjpeg \
libusb \
tiff \
tk \
tcl && \
apk add --update --no-cache --virtual .builddeps \
build-base \
cython-dev \
libxml2-dev \
libxslt-dev \
eudev-dev \
libffi-dev \
openssl-dev \
jpeg-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
openjpeg-dev \
libusb-dev \
tiff-dev \
tk-dev \
tcl-dev && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apk/* && \
pip install -Ur /build/requirements.txt && \
pip install -Ue /build/[u2f] && \
apk del .builddeps && \
rm -rf .builddeps

ENTRYPOINT ["aws-google-auth"]