-2

I am stuck on this error since yesterday. I am trying to run the command docker run hello-world on my Ubuntu bash but it keeps giving the same error. I don't understand what am I doing wrong.

enter image description here

My ~/.bashrc file also has the required environment variables.

enter image description here

enter image description here

swapn652
  • 7
  • 3
  • 2
    If your `.bashrc` file is a PNG-format image like you've attached here, it won't work. Can you [edit] your question to replace the screenshots of terminal windows with the plain-text content of these files instead? You should not normally need to set `$DOCKER_HOST` at all, and if setting it to port 2375 works, it's a major security risk. – David Maze Jul 08 '22 at 13:24
  • Agree with @DavidMaze on both counts. First, recommend reading why we ask that you [not post text as images](https://meta.stackoverflow.com/a/285557/11810933). Second, I think that it is the `DOCKER_HOST` that is *causing* the problem. Try removing it - If it doesn't work, report the error new (as text!) in an edit to your question. Thanks! – NotTheDr01ds Jul 08 '22 at 13:37
  • I'm just curious - As a user with reputation < 15, you should have received a warning message when posting those images that you should include the text - Is that feature not working currently, or did you just ignore it? Want to make sure there's not a bug in the system. Thanks! – NotTheDr01ds Jul 08 '22 at 13:38
  • Yes, the problem was with that DOCKER_HOST thing. And sorry about posting the screenshot instead of the text. I didn't know that. I removed that line and it works fine now. Thank you! – swapn652 Jul 08 '22 at 15:39
  • 2
    @Rogeorge Also another heads-up -- If you find the answer in another question (which you did, according to your answer), then you should flag your question as a "duplicate" of that other question. Thanks! Re: [WSL2 Cannot connect to the Docker daemon](https://stackoverflow.com/questions/60708229/wsl2-cannot-connect-to-the-docker-daemon) – NotTheDr01ds Jul 08 '22 at 16:09

1 Answers1

-2

have you tried to add docker group etc. ? these are the required post installation steps:

sudo groupadd docker
sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated.

source: https://docs.docker.com/engine/install/linux-postinstall/

mcchran
  • 62
  • 3
  • Those instructions are for Docker Engine. This question is regarding Docker Desktop. Docker Desktop automatically adds the `docker` group to a WSL instance and assigns the user to that group when the *"Enable integration with ..."* option is selected, which it is according to the screenshot above. Thanks! – NotTheDr01ds Jul 08 '22 at 13:40
  • oops, have not noticed that ... – mcchran Jul 08 '22 at 13:55