Hello, Could someone please point me to the latest...
# ask-the-community
f
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
@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
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
Also take a look at ImageSpec. You should be able to build images without a Dockerfile.
f
Thanks @Samhita Alla. Thanks @Tommy Nam.