Docker completely remove container and image - docker

Reinstalling gitlab docker issue
So today I messed up accidentally typed docker-compose down instead of stop and since my dockerfile has "latest" tag it tried to update it and it failed now I can't access it.
From my understanding ce version is being discontinued and ee is recommended so I don't mind reinstalling and even loosing my data since there were only two repos anyway but whenever I try to install gitlab-ee:latest I get this error
"It seems you are upgrading from major version 12 to major version 15...."
I did ran docker volume prune and docker system prune -a, but I still get same error. How can I completely delete old ce gitlab and install latest ee version?
Also I'm using laradock so I just replace FROM gitlab-ce:latest to FROM gitlab-ee:latest

From my understanding ce version is being discontinued and ee is recommended
Not that I know of. gitlab-ce Docker image is very much maintained.
And you could reinstall the 12.10.14-ce.0, which would still be compatible with your old version.
By using a FROM gitlab/gitlab-ce:12.10.14-ce.0 instead of gitlab/gitlab-ce:latest means that a docker-compose would not accidentally upgrade your GitLab.

Ok so it might be laradock specific but if anyone encounters something similair I did this:
Keep in mind that this will delete all non running images and volumes so make sure that containers you want to leave is running
docker volume prune
docker system prune
And then (in my case) /home/[your_user]/.laradock/data delete everything gitlab related.
It did actually complained when I tried to pull gitlab-ce but did all steps again and gitlab-ee installed without issues.

Related

Can I roll back to a previous version of Docker Desktop?

On Mac, I'm running Lando inside Docker. I'm on Lando v3.0.1 and was running Docker Desktop v2.2.0.5 successfully.
Docker released stable an update v.2.3.0.3 and I installed it. After that I attempted to run Lando, but got a warning message stating the Docker Desktop version is not supported.
So, I'm wondering if it is possible to roll back to my previous Docker Desktop version without uninstalling Docker.
Download your desired version from the Release Notes.
Open the download, drag "Docker" to "Applications"
Chose to "Replace" the existing installation
Run Docker desktop
All your previous containers should still be there.
If you're using Docker Desktop, I found deselecting the option Use Docker Compose V2 fixed my problems. Spent a long time working on reinstalling things. Definitely worth a try before doing anything big.
[Answer 2022]
As said #patricknelson
Sadly, this no longer works. Now it only says "Existing installation is up to date".
And workaround of Docker Descktop downgrade with retains of the data described below:
Get a list of containers
docker container ls
Commit the container to save the data:
docker commit -p 64bf7c9f7122 new-image
where 64bf7c9f7122 - id of my container
new-image - new image name
Save the committed image with changes to the archive
docker save -o c:\backup.tar new-image
Delete current Docker Desktop
Install desired Docker Desktop version
Unpacking the image in docker
docker load -i c:\backup.tar
run container
docker run --name sample-container new-image
Congrats, all data saved and Docker downgraded 😃
So, I run the installer of the previous Docker Desktop version: 2.2.0.5 - got a warning message stating that a newer Docker already exists and if I wanted to replace it (stop, or keep it both). I selected 'Replace'.
The installation went successful.
But when I open Docker all my running containers were gone.
I run lando to recreate my Drupal 7 site.
I got the "Boomshakala" from lando confirming that the app has started up correctly, and provided with its corresponding vitals -including the APPSERVER URLS.
But when I access the URL, I got an error message:
"Error: the website encounter an unexpected error. Please try again later."
The uncaught exception thrown in shutdown function:
"PDOException: SQLSTATE[]: Base table or view not found:1146 Table 'drupal7.semaphore' doesn't exist...."
To solve this, I imported and old copy of the drupal database site:
lando db-import .sql
then I navigated to the docroot folder, and run a database update:
lando drush upddatedb
All good now; thanks #halfer for your comments!
The quick hack here for Lando specifically, is just to reinstall Lando from the installer for the version you want. We've bundled the supported version of Docker Desktop with Lando itself which means you can always specifically install the supported version when installing Lando. This may wipe out your containers and volumes, so be careful!

Which source/tag should be used to download Odoo 12 community for Synology/Docker

Good Day:
I have been trying to create an Odoo 12 community version container on Docker in Synology DSM. Which source/tag should I use for this purpose?
The following source is the one I have been working with directly from Synology Docker:
https://hub.docker.com/_/odoo/
(Tag: Latest)
The only thing I have been able to do is creating a container for Odoo 12 enterprise, but not for Odoo 12 community.
Please advise.
Regards,
The official Odoo docker version is currently from date 2018-10-08 and it had a bug that showed incorrectly Enterprise version in Settings page also in Community version. So the good news is that you are in fact already running Community version. The bug was fixed in this commit.
The more complicated question is what version of docker image should you run. The official Odoo docker image (library/odoo or _/odoo or just odoo) does not get updated very frequently. It is not updated to fix issues. I would not recommend it for any other use than testing.
You can use other images that are updated more frequently and have static tags, e.g. I maintain an image with nightly Odoo builds. It is named veivaa/odoo. You can use a specific version of Odoo nightly build with tag version-date, e.g. veivaa/odoo:12.0-20181106. The nightly image can be found in Docker store at https://store.docker.com/community/images/veivaa/odoo. This version is updated on ”best effort” bases.
You find more information on running Odoo in Docker in my blog.
It is also not best practice with Docker to use the latest tag in production use or if you need to be able to keep the container stable. This is because you would get a different version depending on when you pull the image. Best practice is to either use a stable nonchanging tag, or build your own Dockerfile and image in own container registry.

Gitlab with Docker won't update

I'm currently using Gitlab using Docker. The container is using the latest image for Gitlab, but the admin area shows me a different version. How can I use the latest one ? I don't understand why Gitlab shows me a different version of what I'm using. I tried gitlab-ctl upgrade command, with no effect.
Docker shows me the correct (latest) image
Administration shows me 11.1.4 (so, I can't benefit 11.4.0 features)
Am I doing thing wrong ? When updating, I just change the image version. Everything works well since months, but now...
So ! I solved my problem. I've mounted a volume on /opt/gitlab, and it seems the upgrade doesn't working when the folder already exists. Just don't mount a volume on this folder.
https://docs.gitlab.com/omnibus/docker/#where-is-the-data-stored does not show at any time this folder should be mounted.

Prevent Kops from replacing docker installation when provisioning nodes

I use custom images (AMIs) configured for machine learning on GPU-enabled EC2 instances.
This means cuda, libcudnn6, nvidia-docker etc are all properly setup on them.
However when Kops starts new nodes from these AMIs (I use cluster-autoscaler) it overrides my properly setup docker.
How can I prevent that?
For now I run a custom script on startup that re-installs nvidia-docker properly, but that's obviously not ideal.
Kops will only install docker if there's a difference between the version it expects to use and the version that is already installed on the node.
Note that Kops will downgrade docker if the installed version is higher than what it expects!
So the solution to my problem was to have a pre-installed version that matches spec.docker.version.
For this we had to downgrade docker to 17.03.2 and nvidia-docker to 2.0.3+docker17.03.2-1.

Options to use latest docker on centos 6?

I would like to try new features in latest version of docker (1.10 for now), like "docker networks" and "docker volume".
I have CentOs 6 and I CAN NOT upgrade OS due to some restrictions (understand I can use latest docker in centos 7). I do have root permission.
I am wondering what's the options I have to try latest docker?
You can try to use a static binary to run docker, but this is all at your own risk; CentOS 6 runs on kernel 2.6, which is 13 years old now. That kernel misses various things needed to run Docker (e.g. Overlay networking is not supported), and is known for having some issues.
Note that running docker-in-docker may get you around "installing" docker 1.10, but will still run on the same kernel, so you'll end up with the same issues
You could install docker-machine and run docker-machine upgrade default
As described here
EDIT - This does not apply to you
But this question is possibly a duplicate of yours

Resources