Home > database >  Paperspace: Docker pull private image
Paperspace: Docker pull private image

Time:10-14

I'd like to pull a private image from Docker Hub in Paperspace Deployment.

It uses a yaml file, in which the command can overwrite the default pull command.

This is the yaml file:

image: image_name/ref
port: xxxx
command:
  - docker login -u 'docker_user' -p 'docker_password'
  - docker pull image_name/ref:latest
resources:
  replicas: 1
  instanceType: C4

I have the following error:

Node State: errored
Error: An error occurred when pulling image:[image_name/ref] from deployment

Note: the commands

  - docker login -u 'docker_user' -p 'docker_password'
  - docker pull image_name/ref:latest

Work from my PC.

CodePudding user response:

command in docker-compose.yaml is used to:

overrides the default command declared by the container image

Not overwrite the default pull command as what you thought.

So, to let docker-compose to pull a private docker image, you need to do a initial docker login before run compose, detail see docker login.

CodePudding user response:

In fact, there is a container menu to specify user and password (see team settings in the top right menu -> containers).

Then you have to use the option "containerRegistry" to pull the image properly: image: image_name/ref containerRegistry: name_in_paperspace port: 5000 resources: replicas: 1 instanceType: C4

Everything is explained in this video:

https://www.youtube.com/watch?v=kPQ7AKwNlWU

  • Related