repo2docker/Dockerfile

50 wiersze
1.3 KiB
Docker
Czysty Zwykły widok Historia

# syntax = docker/dockerfile:1.3
ARG ALPINE_VERSION=3.19
FROM alpine:${ALPINE_VERSION}
2022-12-11 21:08:18 +00:00
RUN apk add --no-cache git python3 python3-dev py3-pip py3-setuptools build-base
2024-03-24 21:18:23 +00:00
# build wheels in a build stage
2024-02-03 17:52:29 +00:00
ENV VIRTUAL_ENV /opt/venv
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}
RUN python3 -m venv ${VIRTUAL_ENV}
ADD . /tmp/src
2021-07-04 17:30:39 +00:00
RUN cd /tmp/src && git clean -xfd && git status
RUN mkdir /tmp/wheelhouse \
&& cd /tmp/wheelhouse \
2024-02-03 17:52:29 +00:00
&& pip install wheel \
&& pip wheel --no-cache-dir /tmp/src \
&& ls -l /tmp/wheelhouse
FROM alpine:${ALPINE_VERSION}
# install python, git, bash, mercurial
2022-12-11 00:11:21 +00:00
RUN apk add --no-cache git git-lfs python3 py3-pip py3-setuptools bash docker mercurial
2024-02-03 17:52:29 +00:00
ENV VIRTUAL_ENV /opt/venv
ENV PATH ${VIRTUAL_ENV}/bin:${PATH}
RUN python3 -m venv ${VIRTUAL_ENV}
# install hg-evolve (Mercurial extensions)
2024-02-03 17:59:02 +00:00
RUN pip install hg-evolve --no-cache-dir
# install repo2docker
COPY --from=0 /tmp/wheelhouse /tmp/wheelhouse
2024-02-03 17:52:29 +00:00
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
RUN git config --system credential.helper env
# add entrypoint
COPY ./docker/entrypoint /usr/local/bin/entrypoint
RUN chmod +x /usr/local/bin/entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint"]
# Used for testing purpose in ports.py
EXPOSE 52000