Skip to content

Moved imagedims to OL8 base image #44

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

Merged
merged 3 commits into from
Dec 15, 2021

Conversation

metamemelord
Copy link
Contributor

Added OL8 based function for imagedims

@sachin-pikle
Copy link
Contributor

@metamemelord I am merging this PR. Please leave a comment here once the new Fn Python FDK OL8 slim base images are available in docker hub.

@sachin-pikle
Copy link
Contributor

sachin-pikle commented Dec 15, 2021

@metamemelord I noticed one small thing in the readme. It says "The Dockerfile that "fn build" would automatically generate to build a Python 3.6 function container image looks like this:" but the Dockerfile shown has the image magick installation steps. We should show the default Fn-generated Dockerfile as-is first before adding the custom steps for image magick. Can you update the readme before I merge the PR?

@metamemelord
Copy link
Contributor Author

Thanks for bringing that to my notice, I will change the documentation to reflect correct information.

@sachin-pikle
Copy link
Contributor

sachin-pikle commented Dec 15, 2021

Hi @metamemelord I tested your changes and here's my feedback. After starting from the fn-generated Dockerfile and adding the microdnf statements for image magick, this is what the final Dockerfile should look like:

FROM fnproject/python:3.6-dev as build-stage
WORKDIR /function
ADD requirements.txt /function/

RUN pip3 install --target /python/  --no-cache --no-cache-dir -r requirements.txt &&\
  rm -fr ~/.cache/pip /tmp* requirements.txt func.yaml Dockerfile .venv &&\
  chmod -R o+r /python
ADD . /function/
RUN rm -fr /function/.pip_cache

FROM fnproject/python:3.6
RUN microdnf install oracle-epel-release-el8 &&\
      microdnf install ImageMagick &&\
      microdnf remove oracle-epel-release-el8 &&\
      microdnf clean all
WORKDIR /function
COPY --from=build-stage /python /python
COPY --from=build-stage /function /function
RUN chmod -R o+r /function
ENV PYTHONPATH=/function:/python
ENTRYPOINT ["/python/bin/fdk", "/function/func.py", "handler"]

@sachin-pikle
Copy link
Contributor

@metamemelord can you please review my changes and confirm?

@metamemelord
Copy link
Contributor Author

Yes, I fixed the dockerfile. I tested the function locally and it is working fine.

@sachin-pikle
Copy link
Contributor

I think your changes accidentally overwrote mine :-) I will add mine back and merge the PR. Please check the diff.

@sachin-pikle sachin-pikle merged commit 486f226 into oracle-samples:master Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants