how do you create a compatible docker file?

I want to run a custom docker file, but I'm not sure how to make one that's compatible.

for example when I use this to create an image that's saved to my registry, the pod seems to start but I can't connect to it over ssh. I noticed that if I picked an official pytorch pod I had checkmarks for ssh and jupter lab, but not if I use my custom one. What's the minimal dockerfile I need to run?

FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime

RUN apt-get update --yes && \
    apt install --yes --no-install-recommends git wget curl bash libgl1 software-properties-common openssh-server nginx && \
    apt-get autoremove -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    echo "en_US.UTF-8 UTF-8" > /etc/locale.gen

EXPOSE 8888
EXPOSE 22
Was this page helpful?