D
Dokploy•10mo ago
Flo

Custom Registry Credentials expiring

I setup the github ghcr.io registry in dokploy, I was able to successfully deploy my changes 3days ago. I just ran a manual deployment and I instantly am greeted with
Pulling
bot Error Head "https://ghcr.io/v2/steamsets/discord-bot/manifests/latest": unauthorized
Error response from daemon: Head "https://ghcr.io/v2/steamsets/discord-bot/manifests/latest": unauthorized
Error :x:
Pulling
bot Error Head "https://ghcr.io/v2/steamsets/discord-bot/manifests/latest": unauthorized
Error response from daemon: Head "https://ghcr.io/v2/steamsets/discord-bot/manifests/latest": unauthorized
Error :x:
is there some bug where it forgets the docker login?
No description
39 Replies
Flo
FloOP•10mo ago
I just added my old token again pressed save and it worked Happend again @Siumauricio would you be able to look into this when you have some time?
Siumauricio
Siumauricio•10mo ago
hmmm question did you update your dokploy server?
Flo
FloOP•10mo ago
in between no but the server restarted imo the token should be presisted tho, I don't want to re-login each time the server restarts / I update
Siumauricio
Siumauricio•10mo ago
yeah that's what I'm thinking 🤔 I guess the auth config is not persisted I will take a look on this
Flo
FloOP•10mo ago
any luck looking into this>
Siumauricio
Siumauricio•9mo ago
I haven't had time to look this I will try to see today @Flo Would you mind to open a issue in github?
Flo
FloOP•9mo ago
Done
Siumauricio
Siumauricio•9mo ago
Just a question, what happen if you enter to the server and automatically login via the terminal? they reset? or they persist the information?
Flo
FloOP•9mo ago
Hm ill have to test that
Siumauricio
Siumauricio•9mo ago
Yeah, because I remember tried to mount the auth config, but it looks like is not possible, but I will research a little bit more about that
Flo
FloOP•9mo ago
GitHub
GitHub - docker/docker-credential-helpers: Programs to keep Docker ...
Programs to keep Docker login credentials safe by storing in platform keystores - docker/docker-credential-helpers
Flo
FloOP•9mo ago
I wonder if that can help the normal docker login doesn't persist
Siumauricio
Siumauricio•9mo ago
have you tried to restart the server?
Siumauricio
Siumauricio•9mo ago
In this issue they say we could mount the folder https://github.com/containrrr/watchtower/discussions/596
GitHub
Mounting config.json and retaining any changes made by docker-login...
Describe the bug After updating from docker 18.09 to 19.03, watchtower can no longer see read updated token to in config.json on the host. This has been working, and is working, fine on servers tha...
Flo
FloOP•9mo ago
dokploy has to persist the token tho no? or do I need to set
DOCKER_CONFIG: /config
volumes:
- <PATH_TO_YOUR_CONFIG_DIRECTORY>/config/:/config/
DOCKER_CONFIG: /config
volumes:
- <PATH_TO_YOUR_CONFIG_DIRECTORY>/config/:/config/
for each compose that uses githubs registry It would be great if that could be handled by dokploy instead and I just setup the registry and call it a day 😅
Siumauricio
Siumauricio•9mo ago
GitHub
dokploy/apps/dokploy/server/utils/builders/compose.ts at canary · D...
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy
Siumauricio
Siumauricio•9mo ago
but the volume is not mounted, maybe I can try to mount to the dokploy container so the auth config is persist
Flo
FloOP•9mo ago
yeah that would be awesome
Siumauricio
Siumauricio•9mo ago
are you using Applications or docker compose? I think I found the solution, would you mind to test it?
Flo
FloOP•9mo ago
Yup Compose
Siumauricio
Siumauricio•9mo ago
Did you run the commands I share above ? I tested and it was working!
Flo
FloOP•9mo ago
alright, when im home from work I will try this thanks! how can I test it afterwards just restarting dokploy
Siumauricio
Siumauricio•9mo ago
Yeah only restart dokploy
Flo
FloOP•9mo ago
hmm I just updated to 0.7.2 and I got the same error message :/
Flo
FloOP•9mo ago
No description
Flo
FloOP•9mo ago
saved the token again, which is also empty in the registry modal and it worked
Flo
FloOP•9mo ago
maybe the issue is that it doesn't save in here?
No description
Siumauricio
Siumauricio•9mo ago
did you run the steps i shared above? because the only way to lose the credentials is because you didn't created the volume
Flo
FloOP•9mo ago
are they not enabled by default in the new sversion?
Siumauricio
Siumauricio•9mo ago
nop, you need to recreate the container in order to assign the new volume
Flo
FloOP•9mo ago
do you have me the command to create the volume again I dont see it in the chat anymore
Siumauricio
Siumauricio•9mo ago
lol, let me check
Flo
FloOP•9mo ago
😅 sorry
Siumauricio
Siumauricio•9mo ago
Run this: 1. docker service rm dokploy 2. Run this
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--mount type=volume,source=dokploy-docker-config,target=/root/.docker \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
--constraint 'node.role == manager' \
dokploy/dokploy:latest
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--mount type=volume,source=dokploy-docker-config,target=/root/.docker \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
--constraint 'node.role == manager' \
dokploy/dokploy:latest
Flo
FloOP•9mo ago
Will i need to re-run this on each update or only this itme
Siumauricio
Siumauricio•9mo ago
no, only 1 time
Flo
FloOP•9mo ago
worked for me only thing that confuses me is that I already had a config.json file in there updating the registry in dokploy didn't seem to write to it Last changed date is still when I manually ran it. I will test it tomorrow again when I remove that file
Siumauricio
Siumauricio•9mo ago
Basically what we did is that the directory /root/.docker that is created internally contains the credentials that you add and if the container dies the credentials will be there.
Flo
FloOP•9mo ago
ah ok so it won't be presisted to the local volume that makes sense then im happy since it seems to work, thank you!

Did you find this page helpful?