Building Docker Containers with Jobs

I have customized a Dockerfile for using PyTorch with GPU, and fastai. I’m trying to use a job to build the image, since I don’t have a GPU on my local.

I tried to follow this documentation:

docs.paperspace.com/gradient/jobs/create-a-job/building-docker-containers-with-jobs

But the command fails:
gradient jobs create --apiKey <api_key> --projectId <project_id> --machineType Free-GPU --workspace --useDockerfile true --buildOnly true --registryTarget https://hub.docker.com/repository/docker/isischameleon/ml-training/ml-training-image:0.1-test --registryTargetUsername --registryTargetPassword
bash: !C: event not found

What should be in “registryTarget” ? I have created a public repository in DockerHub at the address above in the command.

Any other obvious mistakes?

My guess is the issue is related to the Dockerfile – could you share that here?

Hi Daniel,

Thanks for your reply. I finally solved this first hurdle. It was to do with my command. I now have succeeded in the job command:
I had a made a few mistakes (in bold):

  • adding true after "BuildOnly
  • not adding .git at the end of my repository
  • unexisting machine type
    so now it works, … well it attempts to build my container and fails …

So i’m not yet sure the registryTarget options are valid.

I was assuming since I don’t have a GPU on my local, i cannot build this container myself.

gradient jobs create \
        --apiKey <paperspace gradient api key> \
        --projectId <paperspace gradient project id> \
        --machineType **'GPU+'** \
        --workspace 'https://github.com/IsisChameleon/ml-training.**git**' \
        --useDockerfile true \
        **--buildOnly**   \
        --registryTarget isischameleon/ml-training:0.1 \
        --registryTargetUsername <docker hub username> \
        --registryTargetPassword <docker hub psw>

Hey @IsisChameleon It looks mostly correct but there’s an issue with the Dockerfile. This is what I got when I ran your container build job:

It’s failing with /opt/conda/bin/conda: not found

My command:

paperspace jobs create \
--workspace https://github.com/IsisChameleon/ml-training \
--useDockerfile true \
--buildOnly true  \
--registryTarget <dockerhub:tag> \
--registryTargetUsername <dockerhub username> \
--registryTargetPassword <dockerhub password> \
--machineType P5000 \
--container none