This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): add buster image with minimum dependencies
- Loading branch information
hanhxiao
committed
Aug 12, 2019
1 parent
da1bbc0
commit 6aab48c
Showing
3 changed files
with
33 additions
and
21 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,27 +1,18 @@ | ||
FROM python:3.7.4-slim-buster AS dependency | ||
FROM python:3.7.4-slim-buster AS base | ||
|
||
WORKDIR /gnes/ | ||
|
||
COPY setup.py ./setup.py | ||
ADD . ./ | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
build-essential g++ gfortran file binutils \ | ||
python3-dev cython libopenblas-dev && \ | ||
build-essential \ | ||
python3-dev libopenblas-dev && \ | ||
ln -s locale.h /usr/include/xlocale.h && \ | ||
python -c "import distutils.core;s=distutils.core.run_setup('setup.py').install_requires;f=open('requirements_tmp.txt', 'w');[f.write(v+'\n') for v in s];f.close()" && \ | ||
cat requirements_tmp.txt && \ | ||
pip install --no-cache-dir --compile -r requirements_tmp.txt && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install . --no-cache-dir --compile && \ | ||
rm -rf /tmp/* && rm -rf /gnes && \ | ||
apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* && \ | ||
rm /usr/include/xlocale.h | ||
|
||
FROM dependency as base | ||
|
||
ADD . ./ | ||
|
||
RUN pip install . --no-cache-dir --compile && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /gnes | ||
|
||
WORKDIR / | ||
|
||
ENTRYPOINT ["gnes"] |
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,21 @@ | ||
FROM ubuntu:18.04 AS base | ||
|
||
WORKDIR /gnes/ | ||
|
||
ADD . ./ | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
python3-dev python3-pip libopenblas-dev && \ | ||
ln -s locale.h /usr/include/xlocale.h && \ | ||
cd /usr/local/bin && \ | ||
ln -s /usr/bin/python3 python && \ | ||
pip3 install --upgrade pip && \ | ||
pip3 install . --no-cache-dir --compile && \ | ||
rm -rf /tmp/* && rm -rf /gnes && \ | ||
apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* && \ | ||
rm /usr/include/xlocale.h | ||
|
||
WORKDIR / | ||
|
||
ENTRYPOINT ["gnes"] |
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