If you just updated Docker and are having issues with Portainer not connecting to the environment, check this:
Issue: Failed loading environment The environment named <your specific environment> is unreachable
Fix (credit xman601):
Stop Docker
sudo systemctl stop docker
Make sure you have the Docker official repository added for your Ubuntu version. In my case Ubuntu Jammy
sudo apt update sudo apt install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update
Install the specific Docker version
sudo apt install docker-ce=5:28.5.2-1~ubuntu.24.04~noble \ docker-ce-cli=5:28.5.2-1~ubuntu.24.04~noble \ containerd.io
or if you are on 22:
sudo apt install docker-ce=5:28.5.2-1~ubuntu.22.04~jammy \ docker-ce-cli=5:28.5.2-1~ubuntu.22.04~jammy \ containerd.io
sudo apt install docker-ce=5:28.5.2-1~ubuntu.22.04~jammy \ docker-ce-cli=5:28.5.2-1~ubuntu.22.04~jammy \ containerd.io
Prevent Ubuntu from automatically upgrading Docker:
sudo apt-mark hold docker-ce docker-ce-cli
Start Docker again
sudo systemctl start docker sudo systemctl enable docker
Verify the version
docker --version
You should see:
Docker version 28.5.2, build …
Once this issue has been fixed you can run the following to update docker back
sudo apt-mark unhold docker-ce docker-ce-cli
Referance: github.com/portainer/portainer/issues/12925
It should go without saying, you should do your due diligence reviewing and confirming any code snippets on the internet before you drop them in on a production environment.
tophneal@sh.itjust.works 1 day ago
You can also add an override for the docker.service file to specify min api version 1.24. Had to do that last night
irmadlad@lemmy.world 1 day ago
Can you elaborate? I made the post hoping to save someone a couple hours banging their head on the keyboard like I did. LOL
So something like :
sudo nano /usr/lib/systemd/system/docker.serviceWhat was the format of your entry to specify min api version 1.24? I’m curious and always down to learn new tricks.
'presh
deleted@lemmy.world 1 day ago
You just need to do the following:
systemctl edit docker.service
Add this part above the line ### Lines below this comment will be discarded:
[Service] Environment=DOCKER_MIN_API_VERSION=1.24
Save the file and exit
systemctl restart docker
Credit to johannesMEGABAD github.com/portainer/portainer/issues/12925#issue…
tophneal@sh.itjust.works 21 hours ago
Here’s the method I used from one of the issues on GitHub github.com/portainer/portainer/issues/12925#issue…
Iirc my docker.socket wouldn’t let me just stop docker.service to edit it as described in the post, so I made /etc/systemd/system/docker.service.d/override.conf with the 2 required lines. After saving it and running daemon-reload I was able to access my containers in portainer again.