Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The image for the service you're trying to recreate has been removed" #7933

Closed
CrimsonGlory opened this issue Nov 17, 2020 · 11 comments
Closed
Labels

Comments

@CrimsonGlory
Copy link
Contributor

The following error happens when the user is trying to up a service using an image from a private docker hub repo without being logged into docker hub:

"ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing."

Maybe we could change that description to indicate that the user is not logged into docker hub:

"ERROR: The image for the service you're trying to recreate has been removed (or the image is private and you may require 'docker login'). If you continue, volume data could be lost. Consider backing up your data before continuing."

I don't know if it is easy for compose to check weather the user is logged in in docker hub. If so, compose could show the second message only when the user is not logged in.

This was tested with the latest docker compose.

user@host:~/foldername$ sudo docker-compose --version
docker-compose version 1.27.4, build 40524192
user@host:~/foldername$ sudo docker-compose -f distributed.yml up -d --no-recreate worker_no_vt
WARNING: Found orphan containers (foldername_db1_1, foldername_syslog_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Pulling worker_no_vt (dockerhubuser123/foldername:worker_cg_3344)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]N
ERROR: pull access denied for dockerhubuser123/foldername, repository does not exist or may require 'docker login'
user@host:~/foldername$ sudo docker pull dockerhubuser123/foldername:worker_cg_3344
Error response from daemon: pull access denied for dockerhubuser123/foldername, repository does not exist or may require 'docker login'
user@host:~/foldername$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: dockerhubuser123
Password:
WARNING! Your password will be stored unencrypted in /home/user/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
user@host:~/foldername$ sudo docker-compose -f distributed.yml up -d --no-recreate worker_no_vt
WARNING: Found orphan containers (foldername_syslog_1, foldername_db1_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Pulling worker_no_vt (dockerhubuser123/foldername:worker_cg_3344)...
worker_cg_3344: Pulling from dockerhubuser123/foldername
7568c21980bd: Pulling fs layer
4a9f2207c812: Downloading [>                                                  ]  110.1kB/10.8MB
6fe350d2b140: Download complete
d95a2fdc8b3d: Waiting
760eb225f9e8: Waiting
4acc342562b4: Waiting
a7903e427e3f: Waiting
44360edd3f02: Waiting
d7721ae168a3: Waiting
962c432e3e38: Waiting
8154812ac1d3: Waiting
0847dee02492: Waiting
2cbbcbace93f: Waiting
5c99f8c61911: Waiting
780a1b721474: Waiting
e6ab304bcd20: Waiting
1d7e5014f82a: Waiting
09a76902b260: Waiting
9bf84b26ef17: Waiting
166a889cbc4d: Waiting
5408056a1243: Waiting
c0f6a3cae015: Waiting
9debf7360ef6: Waiting
7235beb4b483: Waiting
9aa29cafb800: Waiting
dc8fc45e195c: Waiting

"The image for the service you're trying to recreate has been removed. "

@Anuradha4dm
Copy link

same kind of problem with me

@Mootassame
Copy link

and me

@jdsalaro
Copy link

Ditto 🤚🏼 !

@makamane
Copy link

makamane commented May 6, 2021

same here

@KimJinsu66
Copy link

and me! helllpppppp

@Prateekarora1998
Copy link

This error happens when the image name (image repo name) of the dockerfile is different from the image name that you have provided in the yaml file. Change the image name to the name that you provided in your yaml file. My issue got solved by doing this. Hope it helps you too.

@ag-TJNII
Copy link

ag-TJNII commented Aug 13, 2021

Agreed on this being a bad error message. I've spent about an hour angrily trying to figure our how to force bypass this for use in a CI pipeline because the error lead me to believe that Compose was keeping some sort of state squirreled away after a rm that let it detect if the image changed and warn if volume data might be altered.

What was really happening was my source image just didn't exist and couldn't be pulled. This error message should be "source image does not exist", not "If you continue, volume data could be lost."

@stale
Copy link

stale bot commented Mar 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 30, 2022
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 17, 2022
@gokul656
Copy link

gokul656 commented Jun 1, 2022

Same issue with me!

@ongteckwu
Copy link

ongteckwu commented Jun 21, 2022

Use https://github.com/awslabs/amazon-ecr-credential-helper
Do
brew install docker-credential-helper-ecr
then
Place the docker-credential-ecr-login binary on your PATH and set the contents of your ~/.docker/config.json file to be:

{
	"credsStore": "ecr-login"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants