Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal Docker image size based on Alpine
- Loading branch information
Abhishek Singh
committed
Jun 15, 2020
1 parent
2d85d3d
commit 5621980
Showing
3 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
FROM pypy:3-slim | ||
FROM python:3-alpine as base | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install g++ | ||
RUN apt-get -y install libzmq3-dev | ||
WORKDIR /svc | ||
|
||
COPY . /sqlite_rx | ||
WORKDIR /sqlite_rx | ||
RUN apk update && apk add build-base libzmq musl-dev zeromq-dev | ||
|
||
RUN pypy3 -m pip install -r requirements.txt | ||
RUN pypy3 setup.py install | ||
RUN pip install --upgrade pip | ||
RUN pip install Cython | ||
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels sqlite_rx | ||
|
||
|
||
FROM python:3-alpine | ||
RUN apk update && apk add libzmq | ||
|
||
COPY --from=base /svc /svc | ||
WORKDIR /svc | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-index --find-links=/svc/wheels sqlite_rx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM python:3-alpine as base | ||
|
||
WORKDIR /svc | ||
|
||
RUN apk update && apk add build-base libzmq musl-dev zeromq-dev | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install Cython | ||
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels sqlite_rx | ||
|
||
|
||
FROM python:3-alpine | ||
RUN apk update && apk add libzmq | ||
|
||
COPY --from=base /svc /svc | ||
WORKDIR /svc | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-index --find-links=/svc/wheels sqlite_rx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters