https://flyte.org logo
#ask-the-community
Title
# ask-the-community
f

Frank Shen

06/27/2023, 11:32 PM
Hello, Could someone please point me to the latest docker file sample for building a custom flyte image with added custom python packages? I will install the latest flytekit release in it, plus my custom packages. The one I am currently referencing is old https://github.com/flyteorg/flytesnacks/tree/master/cookbook/integrations/kubernetes/k8s_spark. And I heard I don’t have to include spark related commands with the latest flytekit anymore.
s

Samhita Alla

06/28/2023, 4:46 AM
@Frank Shen, you can use the following as reference. https://github.com/flyteorg/flyte-conference-talks/blob/main/scipy-2023/Dockerfile You needn't copy the code if you're fast registering your tasks and workflows.
And I heard I don’t have to include spark related commands with the latest flytekit anymore.
Yes! https://github.com/flyteorg/flytekit/pull/1616
t

Tommy Nam

06/28/2023, 9:08 AM
Copy code
FROM <http://ghcr.io/flyteorg/flytekit:tag|ghcr.io/flyteorg/flytekit:tag> # whichever tag you want to build on

USER root

# Upgrade pip, git not needed if you don't want it
RUN apt-get -y install git && pip install --upgrade pip

# Install custom packages
RUN pip install ........ \
     .......

USER flytekit

CMD [] # Not needed
This is a basic Dockerfile structure we use to build custom images @Frank Shen
s

Samhita Alla

06/28/2023, 9:28 AM
Also take a look at ImageSpec. You should be able to build images without a Dockerfile.
f

Frank Shen

06/28/2023, 5:43 PM
Thanks @Samhita Alla. Thanks @Tommy Nam.