Skip to content

Commit

Permalink
Put everything inside a venv
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Mar 23, 2024
1 parent dd9f6ad commit 756e7d1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@ FROM alpine:${ALPINE_VERSION}
RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base

# build wheels in first image
ENV VIRTUAL_ENV /opt/venv
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}

RUN python3 -m venv ${VIRTUAL_ENV}

ADD . /tmp/src
RUN cd /tmp/src && git clean -xfd && git status
RUN mkdir /tmp/wheelhouse \
&& cd /tmp/wheelhouse \
&& pip3 install wheel \
&& pip3 wheel --no-cache-dir /tmp/src \
&& pip install wheel \
&& pip wheel --no-cache-dir /tmp/src \
&& ls -l /tmp/wheelhouse

FROM alpine:${ALPINE_VERSION}

# install python, git, bash, mercurial
RUN apk add --no-cache git git-lfs python3 py3-pip py3-setuptools bash docker mercurial

ENV VIRTUAL_ENV /opt/venv
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}

RUN python3 -m venv ${VIRTUAL_ENV}

# install hg-evolve (Mercurial extensions)
RUN pip3 install hg-evolve --user --no-cache-dir
RUN pip install hg-evolve --user --no-cache-dir

# install repo2docker
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
RUN pip3 install --no-cache-dir --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
&& pip3 list
RUN pip install --no-cache-dir --ignore-installed --no-deps /tmp/wheelhouse/*.whl \
&& pip list

# add git-credential helper
COPY ./docker/git-credential-env /usr/local/bin/git-credential-env
Expand Down

0 comments on commit 756e7d1

Please sign in to comment.