Skip to content

feat: [WIP] fix blockers for podman compatibility #110

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

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 3 additions & 3 deletions tesseract_core/sdk/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,12 @@ def build_image(
remote_dependencies = []
local_dependencies = []

local_requirements_path = build_dir / "local_requirements"
Path.mkdir(local_requirements_path)
if local_dependencies:
local_requirements_path = build_dir / "local_requirements"
Path.mkdir(local_requirements_path)
for dependency in local_dependencies:
src = Path(src_dir) / dependency
dest = build_dir / "local_requirements" / src.name
dest = local_requirements_path / src.name
if src.is_file():
copy(src, dest)
else:
Expand Down
5 changes: 3 additions & 2 deletions tesseract_core/sdk/templates/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN groupadd -g 1000 tesseractor && \
useradd -u 1000 -g 1000 --create-home -s /bin/bash tesseractor
WORKDIR /tesseract
RUN chown tesseractor:tesseractor /tesseract
USER tesseractor

# Set environment variables
ENV TESSERACT_NAME="{{ config.name }}" \
Expand All @@ -70,6 +68,9 @@ ENV TESSERACT_NAME="{{ config.name }}" \
COPY --from=build_stage /python-env /python-env
COPY "{{ tesseract_source_directory }}/tesseract_api.py" ${TESSERACT_API_PATH}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, you can use COPY --chown=tesseractor:tesseractor here instead of running chown separately on the file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we'll need to do the same for copying across extra_packages which was required to get the capsule optimisation file working.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dionhaefner thanks, that's a good tip. do you prefer doing it file-by-file instead of chown -R on the whole directory at the end? I'm happy with either approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe this is a best practice that has slightly more well-behaved Docker caching and whatnot.


RUN chown -R tesseractor:tesseractor /tesseract
USER tesseractor

ENV PATH="/python-env/bin:$PATH"

{% if config.build_config.package_data %}
Expand Down
Loading