Skip to content

Commit dc76c92

Browse files
committed
Dockerfile cleanup
1 parent 9956b4a commit dc76c92

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.git/
2+
build
3+
dist
4+
*.egg-info
5+
*.egg/
6+
*.pyc
7+
*.swp
8+
.tox
9+
.coverage
10+
html/*
11+
**/__pycache__
12+
docs/
13+
venv*
14+
tests/

Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,29 @@ ARG PIP_FLAGS
66
SHELL ["/bin/bash", "-c"]
77

88
ENV DEBIAN_FRONTEND noninteractive
9-
ENV PATH="/root/.local/bin:${PATH}"
9+
ENV HOME /root
10+
WORKDIR $HOME
1011

11-
12-
RUN apt-get update && apt-get install -y \
12+
RUN apt-get update && apt-get install -y --no-install-recommends \
1313
ca-certificates python3 python3-pip python3-venv libgl1-mesa-dev libglib2.0-0 libsm6 libxrender1 libxext6 nano vim htop && \
1414
rm -rf /var/lib/apt/lists/*
1515

1616
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
1717
RUN update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 1
1818

19-
ENV VIRTUAL_ENV=/tmp/superannotatesdk
19+
ENV VIRTUAL_ENV=$HOME/venv_superannotatesdk
2020
RUN python -m venv ${VIRTUAL_ENV}
2121
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
2222

23-
RUN apt-get install -y build-essential && \
23+
RUN apt-get update && apt-get install -y --no-install-recommends build-essential && \
2424
pip install --no-cache-dir shapely && \
2525
pip install --no-cache-dir ${PIP_FLAGS} superannotate && \
26-
apt-get remove -y build-essential && \
27-
apt-get -y autoremove && \
2826
rm -rf /root/.cache/pip && \
29-
rm -rf /var/lib/apt/lists/*
27+
apt-get remove -y build-essential && \
28+
rm -rf /var/lib/apt/lists/* && \
29+
apt-get purge -y --auto-remove && \
30+
apt-get clean -y
31+
32+
RUN mkdir -p $HOME/.superannotate
3033

3134
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)