-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.12-slim
# Install poetry
# Thanks to Soof Golan and jjmerelo from StackOverflow: https://stackoverflow.com/a/72465422
ARG POETRY_VERSION=1.8.2
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Create a venv and install Poetry there
RUN /usr/local/bin/python3.12 -m venv $POETRY_VENV
RUN $POETRY_VENV/bin/python -m pip install -U pip setuptools
RUN $POETRY_VENV/bin/python -m pip install poetry==${POETRY_VERSION}
# Add Poetry to the PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# Print which git
RUN echo "which git: $(which git)"
# Install git
RUN apt-get -yq update && \
apt-get -yq install git && \
rm -rf /var/lib/apt/lists/*
# Copy the action
COPY ["poetry.lock", "pyproject.toml", "/action/"]
COPY ["get_release_version_action/", "/action/get_release_version_action/"]
# Install dependencies
RUN poetry -C /action install --no-interaction --no-cache --without dev
RUN poetry -C /action install --no-interaction --no-cache --only-root
ENV PYTHONPATH="/action"
RUN chmod +x /action/get_release_version_action/entrypoint.sh
ENTRYPOINT ["/action/get_release_version_action/entrypoint.sh"]