Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small docker improvements #230

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# Ignore everything
*

# But not these files...
!README.md
!stitching/
!pyproject.toml
!setup.cfg
__pycache__/
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM python:3.11 AS builder

WORKDIR /stitching
COPY . .
RUN pip install build
# we use opencv headless within docker, otherwise we get errors
RUN sed -i 's/opencv-python/opencv-python-headless/g' setup.cfg
RUN python -m build

COPY setup.cfg pyproject.toml README.md .
COPY stitching/ ./stitching/

RUN pip install --no-cache-dir build && \
sed -i 's/opencv-python/opencv-python-headless/g' setup.cfg && \
python -m build

FROM python:3.11-slim

WORKDIR /stitching
COPY --from=builder /stitching/dist/stitching-*.whl .
RUN pip install stitching-*.whl
RUN pip install --no-cache-dir stitching-*.whl && \
rm stitching-*.whl

# compile largestinteriorrectangle (JIT)
RUN python -c "import largestinteriorrectangle"
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ is available after installation

`stitch -h` show the help

`stitch *` stitches all files in the current directory
`stitch *.jpg` stitches all jpg files in the current directory

`stitch img_dir/IMG*.jpg` stitches all files in the img_dir directory
starting with "IMG" and ending with ".jpg"

`stitch img1.jpg img2.jpg img3.jpg`
stitches the 3 explicit files of the current directory

Enable verbose mode with `stitch * -v`.
Enable verbose mode with `stitch *.jpg -v`.
This will create a folder where all intermediate results are stored so that
you can find out where there are problems with your images, if any

Expand All @@ -56,9 +56,7 @@ Docker image
/path/to/data:/data openstitching/stitch:{version} -h`

You can use the Python CLI as described above
(read "current directory" as "/data directory"). NOTE a single `*` wont
work in linux because of the host shell expansion, you must use more
explicit file pattern / file names.
(read "current directory" as "/data directory").

### Python Script

Expand Down
Loading