Skip to content

Commit 5621980

Browse files
author
Abhishek Singh
committed
Minimal Docker image size based on Alpine
1 parent 2d85d3d commit 5621980

3 files changed

Lines changed: 38 additions & 13 deletions

File tree

Dockerfile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
FROM pypy:3-slim
1+
FROM python:3-alpine as base
22

3-
RUN apt-get update
4-
RUN apt-get -y install g++
5-
RUN apt-get -y install libzmq3-dev
3+
WORKDIR /svc
64

7-
COPY . /sqlite_rx
8-
WORKDIR /sqlite_rx
5+
RUN apk update && apk add build-base libzmq musl-dev zeromq-dev
96

10-
RUN pypy3 -m pip install -r requirements.txt
11-
RUN pypy3 setup.py install
7+
RUN pip install --upgrade pip
8+
RUN pip install Cython
9+
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels sqlite_rx
10+
11+
12+
FROM python:3-alpine
13+
RUN apk update && apk add libzmq
14+
15+
COPY --from=base /svc /svc
16+
WORKDIR /svc
17+
18+
RUN pip install --upgrade pip
19+
RUN pip install --no-index --find-links=/svc/wheels sqlite_rx

dockerfiles/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3-alpine as base
2+
3+
WORKDIR /svc
4+
5+
RUN apk update && apk add build-base libzmq musl-dev zeromq-dev
6+
7+
RUN pip install --upgrade pip
8+
RUN pip install Cython
9+
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels sqlite_rx
10+
11+
12+
FROM python:3-alpine
13+
RUN apk update && apk add libzmq
14+
15+
COPY --from=base /svc /svc
16+
WORKDIR /svc
17+
18+
RUN pip install --upgrade pip
19+
RUN pip install --no-index --find-links=/svc/wheels sqlite_rx
20+

dockerfiles/Dockerfile_cpython

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ FROM alpine:edge
22

33
RUN apk update && apk add build-base libzmq musl-dev python3 python3-dev zeromq-dev py-pip
44

5-
COPY . /sqlite_rx
6-
WORKDIR /sqlite_rx
7-
85
RUN pip install -U Cython
9-
RUN pip install -r requirements.txt
10-
RUN pip install -e .
6+
RUN pip install -U sqlite_rx
7+
RUN apk del build-base musl-dev python3-dev zeromq-dev

0 commit comments

Comments
 (0)