Skip to content

Commit d6ce4a7

Browse files
committed
re-order Dockerfile stages
1 parent c39fcad commit d6ce4a7

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@ COPY Pipfile* /var/lib/pandas/
99
RUN pipenv lock --requirements > requirements.txt
1010
RUN pipenv lock --requirements --dev > requirements-dev.txt
1111

12-
FROM python:${PYTHON_VERSION}-alpine as alpine
13-
WORKDIR /var/lib/pandas/
14-
COPY --from=lock /var/lib/pandas/ .
15-
RUN apk add --no-cache --virtual .build-deps g++ && \
16-
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
17-
pip install $(grep numpy requirements.txt) && \
18-
pip install -r requirements.txt && \
19-
apk del .build-deps
20-
21-
FROM python:${PYTHON_VERSION}-slim AS slim
12+
FROM python:${PYTHON_VERSION} AS latest
2213
WORKDIR /var/lib/pandas/
2314
COPY --from=lock /var/lib/pandas/ .
2415
RUN pip install $(grep numpy requirements.txt) && \
@@ -30,8 +21,17 @@ COPY --from=lock /var/lib/pandas/ .
3021
RUN pip install $(grep numpy requirements.txt) && \
3122
pip install -r requirements.txt -r requirements-dev.txt
3223

33-
FROM python:${PYTHON_VERSION} AS latest
24+
FROM python:${PYTHON_VERSION}-slim AS slim
3425
WORKDIR /var/lib/pandas/
3526
COPY --from=lock /var/lib/pandas/ .
3627
RUN pip install $(grep numpy requirements.txt) && \
3728
pip install -r requirements.txt
29+
30+
FROM python:${PYTHON_VERSION}-alpine as alpine
31+
WORKDIR /var/lib/pandas/
32+
COPY --from=lock /var/lib/pandas/ .
33+
RUN apk add --no-cache --virtual .build-deps g++ && \
34+
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
35+
pip install $(grep numpy requirements.txt) && \
36+
pip install -r requirements.txt && \
37+
apk del .build-deps

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ default: $(STAGES)
1010
mkdir -p $@
1111

1212
.docker/lock: Pipfile
13-
.docker/alpine: .docker/lock Pipfile.lock
14-
.docker/slim: .docker/alpine
15-
.docker/jupyter: .docker/slim
16-
.docker/latest: .docker/jupyter
13+
.docker/latest: .docker/jupyter Pipfile.lock
14+
.docker/jupyter: .docker/latest
15+
.docker/slim: .docker/jupyter
16+
.docker/alpine: .docker/slim
1717
.docker/%: | .docker
1818
docker build --iidfile $@ --tag $(REPO):$* --target $* .
1919

0 commit comments

Comments
 (0)