Skip to content
Permalink
Browse files

feat(docker): add buster image with minimum dependencies

  • Loading branch information...
hanxiao committed Aug 12, 2019
1 parent da1bbc0 commit 6aab48c89939c69dfe2533cb45fed651d668b12b
Showing with 33 additions and 21 deletions.
  1. +7 −16 Dockerfiles/buster.Dockerfile
  2. +21 −0 Dockerfiles/ubuntu.Dockerfile
  3. +5 −5 docker-push.sh
@@ -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"]
@@ -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"]
@@ -20,26 +20,26 @@ _docker_push() {

_select_dockerfile() {
PS3='Please select the Dockerfile you want to build (type 1, 2, 3, ...): '
options=("Dockerfile" "alpine.Dockerfile" "buster.Dockerfile" "ubuntu.Dockerfile")
options=("full(~7.2GB)" "alpine(~300MB)" "buster(~800MB)" "ubuntu")
select opt in "${options[@]}"
do
case $opt in
"Dockerfile")
"full(~7.2GB)")
export DOCKER_FILE='Dockerfiles/full.Dockerfile'
export OS_TAG='full'
break
;;
"alpine.Dockerfile")
"alpine(~300MB)")
export DOCKER_FILE='Dockerfiles/alpine.Dockerfile'
export OS_TAG='alpine'
break
;;
"buster.Dockerfile")
"buster(~800MB)")
export DOCKER_FILE='Dockerfiles/buster.Dockerfile'
export OS_TAG='buster'
break
;;
"ubuntu.Dockerfile")
"ubuntu")
export DOCKER_FILE='Dockerfiles/ubuntu.Dockerfile'
export OS_TAG='ubuntu'
break

0 comments on commit 6aab48c

Please sign in to comment.
You can’t perform that action at this time.