Hello, Could someone please point me to the latest...
# flyte-support
s
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.
t
@salmon-refrigerator-32115, 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
f
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 @salmon-refrigerator-32115
🙌 2
t
Also take a look at ImageSpec. You should be able to build images without a Dockerfile.
s
Thanks @tall-lock-23197. Thanks @fancy-plumber-70674.
155 Views