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.
2
Answers
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
command
indocker-compose.yaml
is used to: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 initialdocker login
before run compose, detail see docker login.