Docker stuck on starting-ubuntu22.04

previously I’m using docker-desktop-v4.27 on my machine. While building an multi-staged image, everytime I got credential errors, after lots of try I thought to reinstall it. Now with the newer version 4.28.0 it get stuck on starting. I uninstalled & then install it also but nothing changed. (docker is running, the issue with docker desktop)

docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete 
Digest: sha256:d000bc569937abbe195e20322a0bde6b2922d805332fd6d8a68b19f524b7d21d
Status: Downloaded newer image for hello-world:latest

Hello from Docker!

services

service --status-all
 [ + ]  acpid
 [ + ]  docker

docker info

OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 7.449GiB
 Name: zenbook
 ID: 18262889-3d79-4c25-8aa7-a5826a186f0b
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

tried subuild also as suggested

sudo echo $USER:10000:65536 >> /etc/subuid
bash: /etc/subuid: Permission denied

:thinking:

Who sugested it that way? :slight_smile:

That just runs echo as root and tries to redirect the output to /etc/subuid as a normal user. This is how you could do it:

echo $USER:10000:65536 | sudo tee --append /etc/subuid

or

sudo sh -c "echo $USER:10000:65536 >> /etc/subuid"

It doesn’t seem like Docker Desktop. It shows zenbook. Are you sure you didn’t install Docker CE as well while you tried to reinstall Docker Desktop?

Check the contexts this way:

docker context ls
1 Like

subuild I found in ubuntu community :slightly_smiling_face:
Later I found that I set the buildkit:true in features.json file after that It get on starting, after removing it, works normally.

Really I got stuck with pushing multi-stage application. Somewhere I found to turn on buildkit to true, and from there It started causing the issue. Later on reddit I found to “remove the config.json” after that I am able to push the image.(really thinking that it is right?)

can you do me a favour that trying out thing first to check whether its working is a good or something better can be done ? As a student I trying my best to understand these tools but sometimes I get too stuck that started reading random blogs & to fix it. :confused:

I’m not sure I understand what you mean. Would you like me to try something on my machine, or you mean the Developers of Docker Desktop should try the upgrade? I’m sure they do, but I’m just a community member.

When buildkit was introduced it was optional and you could enable it when you wanted to. Then Docker Desktop enabled buildkit by default, but you could still disable it in the json file or by setting an environment variable. The next step was that a new builder become buildx which used buildkit by default. So buildkit was enabled everywhere by default, not only in Docker Desktop, but you could still disable it. If I remember correctly, when I tried to disable buildkit for testing, a warning appeared teling me I would not always be able to disable buildkit in the future. So I wouldn’t be surprised if one day that buildkit option in the json files would be removed and the file became invalid when buildkit is set in the json.

However, I tried setting that line on my MacBook, and I could not break Docker Desktop. I also updated to the latest version and no problem.

When removing the config.json is needed, that means something in that file was invalid. But even then I would make a copy of that file, try to delete the json, test it, and if it works, I would move the file back and remove some configs one by one.

One thing I would like to see in the future is better error messages when Docker Desktop fails. There are some errors that are very specific, like when I broke my features.json and it ws syntactically inorrect it showed me it had an unnecessary comma character after the last value. In other cases, we still have to do some debugging.

My personal opinion and many people don’t agree with me is that beginners should start with getting familiar with Docker CE without the Desktop and use Docker Desktop when they need its features. On Linux, I always use Docker CE, but on macOS and Windows I use Docker Desktop, although very rarely on Windows. But I already know what to expect and I’m lucky because I had no serious problem with Docker Desktop for years.

Have you run this command by the way?

I’m not sure I understand what you mean. Would you like me to try something on my machine, or you mean the Developers of Docker Desktop should try the upgrade? I’m sure they do, but I’m just a community member.

No, No I just get confused because I’m trying to learn these tools use them and build something with them(I’m a student). So that I can learns things that are relevant today. But people in my locality don’t know about opensource & their need. That’s why I have to go with hit & trail approach. read books, do some hands-on (assuming that with number of trials I will build the logic by learning from my error). sometimes gets scared/frustrated when things don’t work as thought, I can’t ask also in my locality. Getting feedback to improve myself is the issue in my case. Thats why I asked you (uncertainly). I’m not trying to mean that (you people are better than me, I’m just asking how can I become like you ?)

I installed the docker engine also
Here is the output of docker context ls :

NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                  KUBERNETES ENDPOINT   ORCHESTRATOR
default *           moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                                            
desktop-linux       moby                Docker Desktop                            unix:///home/parth/.docker/desktop/docker.sock                         

If you don’t need Docker CE, uninstall it and keep Docker Desktop. If you don’t need Docker desktop, uninstall it and use Docker CE. If you want to learn about both, make sure you are in the right context. The default is Docker CE and desktop-linux is Docker Desktop. Since you are using the default context now, if you want to switch to Docker Desktop, run

docker context use desktop-linux

When you have an error, you should share that, not a working command. I was confused too, and as you can see I didn’t even react to that part. These errors usually happen on Linux when you have Docker Desktop and the installation guide includes installling a credential manager. If you haven’T done that, do it. This is where it is mentioned:

Since there is only one client, your client config will be used for connecting Docker CE and Docker Desktop. The credential manager itself is good, but when you are not an advanced Linux user and you never used “pass” either, it is harder to get to the point when you can finally build an image. It is easier on Windows or on macOS, but the installation process of the Desktop is more complicated on Linux.

You could remove the client config ($HOME/.docker/config.json or just the credential manager or the credStore setting:

https://docs.docker.com/reference/cli/docker/login/#credential-stores

But if all you need is run Docker containers, you can uninstall the Desktop, remove the entire $HOME/.docker folder and play with Docker CE without credential stores. When you know the basics, if you prefer using a Desktop application, you can uninstall Docker CE and use Docker Desktop for development, but when you are on a server, you won’t run Docker Desktop, you will run Docker CE, so you will need to learn about that.

You basically described it, but read the documentations, always search for official sources, read blogposts too, see how others do things, but always focus on the documentation and use blogposts to understand what you can’t from the docs. Practice, try everything, think for days or weeks if necessary, and… do it for years (depending on how much you already know).

1 Like