You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import sys
import os
from PIL import Image
from json import loads
def main(location):
im = Image.open(location)
im.thumbnail((120,120), Image.ANTIALIAS)
image_path="thumbnail.jpg"
im.save(image_path)
print("Thumbnail generated thumbnail.jpg")
return image_path
Create Dockerfile to load the python file and the dependency
FROM ubuntu
MAINTAINER Name (<email id>)
COPY thumbnail.py ./
RUN apt-get update
RUN apt install python3-pip -y
RUN pip3 install Pillow
CMD ["python3", "./thumbnail.py"]
Create an action called sprint using the Docker file containing the code
$ wsk -i action create sprint <docker hub path of the image>