Skip to content

Commit

Permalink
Merge pull request #11 from withlogicco/poetry-1.2
Browse files Browse the repository at this point in the history
Bump Poetry to `1.2`
  • Loading branch information
parisk authored Sep 8, 2022
2 parents c0d6532 + 6ddc41f commit 2dc161b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
POETRY_VERSION: 1.1.15
POETRY_VERSION: 1.2.0
GHCR_IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/poetry

jobs:
Expand Down
19 changes: 4 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
ARG PYTHON_VERSION=3.10
ARG VARIANT=buster

FROM python:${PYTHON_VERSION}-alpine as installation-base

WORKDIR /etc
ARG POETRY_VERSION=1.1.15
RUN wget https://raw.githubusercontent.com/python-poetry/poetry/${POETRY_VERSION}/get-poetry.py
ARG POETRY_HOME=/usr/local/poetry
ENV POETRY_HOME=${POETRY_HOME}
RUN python /etc/get-poetry.py


FROM python:${PYTHON_VERSION}-${VARIANT}

ENV PYTHONUNBUFFERED=1

ARG PIP_VERSION=22.2.2
RUN pip install --upgrade pip==${PIP_VERSION}
ARG SETUPTOOLS_VERSION=65.3.0
RUN pip install --upgrade pip==${PIP_VERSION} setuptools==${SETUPTOOLS_VERSION}

ARG POETRY_HOME=/usr/local/poetry
ENV POETRY_HOME=${POETRY_HOME}
COPY --from=installation-base ${POETRY_HOME} ${POETRY_HOME}
RUN ln -s ${POETRY_HOME}/bin/poetry /usr/local/bin/poetry
ARG POETRY_VERSION=1.2.0
RUN pip install poetry==${POETRY_VERSION}
RUN poetry config virtualenvs.create false

WORKDIR /usr/src/app
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Docker Poetry is a Docker image for Python projects with dependencies managed by Poetry.

![Poetry](https://img.shields.io/badge/Poetry-1.1.14-purple) ![Python](https://img.shields.io/badge/Python-3.10%20(default)%20%7C%203.9%20%7C%203.8%20%7C%203.7-blue) ![Variants](https://img.shields.io/badge/Variants-Buster%20(default)%20%7C%20Slim%20%7C%20Alpine-orange
![Poetry](https://img.shields.io/badge/Poetry-1.2.0-purple) ![Python](https://img.shields.io/badge/Python-3.10%20(default)%20%7C%203.9%20%7C%203.8%20%7C%203.7-blue) ![Variants](https://img.shields.io/badge/Variants-Buster%20(default)%20%7C%20Slim%20%7C%20Alpine-orange
)

## Why
Expand All @@ -25,17 +25,17 @@ This will use the default Python version (latest) and image variant (Buster). Yo

### Examples

- Poetry 1.1.14: `ghcr.io/withlogicco/poetry:1.1.14`
- Poetry 1.1.14 on Python 3.10: `ghcr.io/withlogicco/poetry:1.1.14-python-3.10`
- Poetry 1.1.14 on Buster: `ghcr.io/withlogicco/poetry:1.1.14-buster`
- Poetry 1.1.14 on Python 3.10 and Buster: `ghcr.io/withlogicco/poetry:1.1.14-python-3.10-buster`
- Poetry 1.2.0: `ghcr.io/withlogicco/poetry:1.2.0`
- Poetry 1.2.0 on Python 3.10: `ghcr.io/withlogicco/poetry:1.2.0-python-3.10`
- Poetry 1.2.0 on Buster: `ghcr.io/withlogicco/poetry:1.2.0-buster`
- Poetry 1.2.0 on Python 3.10 and Buster: `ghcr.io/withlogicco/poetry:1.2.0-python-3.10-buster`

## Usage

First, pick the image tag you wish to use. Then, copy your `pyproject.toml` and `poetry.lock` files in the working directory (`/usr/src/app`), for optimal caching and run `poetry install`. Example:

```dockerfile
FROM ghcr.io/withlogicco/poetry:1.1.14
FROM ghcr.io/withlogicco/poetry:1.2.0

COPY pyproject.toml poetry.lock ./
RUN poetry install
Expand Down

0 comments on commit 2dc161b

Please sign in to comment.