Docker update version windows

DOCKER

Docker has become a critical component for developers and system administrators, offering a robust platform for developing, shipping, and running applications in containers. Regular updates ensure optimal performance, security, and access to new features. In this guide, we will provide detailed steps to update Docker to version 27.1.1 on Linux and Windows Subsystem for Linux (WSL).

Why Update Docker?

Before diving into the update process, let’s explore why updating Docker is essential:

  • New Features: Each release includes new features that enhance functionality and usability.

  • Performance Improvements: Updates often contain performance boosts to optimize resource usage and speed.

  • Bug Fixes: Regular updates fix known issues, improving stability and reliability.

  • Security Enhancements: Keeping Docker up to date is crucial for protecting your system against vulnerabilities.

System Requirements

Before updating, ensure that your system meets the following requirements:

  • A supported version of Linux (Ubuntu, CentOS, Debian, etc.) or WSL with an updated kernel.

  • Administrative privileges to install or update software packages.

  • Existing installation of Docker prior to the update.

Pre-Update Considerations

Backup Your Data

Always back up existing Docker images and containers:

docker save -o my_images.tar $(docker images -q)
docker ps -a > my_containers.txt

Verify Current Docker Version

Check your current Docker version to confirm the need for an update:

Updating Docker on Linux

Follow these steps to update Docker to version 27.1.1 on a Linux system:

Step 1: Remove the Old Version

If you have an older version of Docker, it’s advisable to remove it first:

sudo apt-get remove docker docker-engine docker.io containerd runc

Step 2: Install Dependencies

Update the package list and install dependencies:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

Step 3: Add Docker’s Official GPG Key

To ensure that you are installing Docker from a trusted source, add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Step 4: Set up Docker’s Stable Repository

Next, add Docker’s stable repository to your system:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Step 5: Update the Package Index

Update the package database to reflect the added repository:

Step 6: Install Latest Version of Docker

Finally, install Docker version 27.1.1:

sudo apt-get install docker-ce=5:27.1.1~3-0~ubuntu-focal docker-ce-cli=5:27.1.1~3-0~ubuntu-focal containerd.io

Step 7: Start the Docker Service

Once installed, start and enable the Docker service to run on boot:

sudo systemctl start docker
sudo systemctl enable docker

Step 8: Verify Installation

Confirm that Docker has been updated successfully:

Updating Docker on Windows Subsystem for Linux (WSL)

To update Docker on WSL, you first need to ensure that Docker Desktop is installed. Here’s how to update it:

Step 1: Open Docker Desktop

Launch Docker Desktop from your Start Menu. Ensure WSL integration is enabled.

Step 2: Check for Updates

  • Click on the gear icon ⚙️ for settings, then select “About”.

  • Click the “Check for Updates” button.

Step 3: Install the Latest Version

If there is a new update available, Docker Desktop will prompt you to download and install it. Follow the instructions to install version 27.1.1.

Step 4: Verify Docker in WSL

Open WSL and run:

This should display the updated version.

Troubleshooting Common Issues

  • Permission Denied: If you encounter permission issues, check if your user is added to the docker group:

    sudo usermod -aG docker $USER
    

    Log out and back in again to apply group changes.

  • Service Fails to Start: If the Docker service does not start, check the logs for any error messages:

    sudo journalctl -u docker.service
    

Conclusion

Updating Docker to version 27.1.1 on Linux or WSL is a straightforward process that can significantly enhance your containerization experience. By following the outlined steps, you can ensure that you are leveraging the latest features, performance enhancements, and security updates.

Don’t forget to regularly check for updates and keep your Docker installation current.

Further Reading

  • Docker Documentation

  • Docker GitHub Repository

By keeping your Docker installation updated, you’re one step closer to maintaining a secure and efficient development environment. Happy coding!

Suggested Articles

DOCKER

DOCKER

DOCKER

DOCKER

DOCKER

DOCKER

Узнать актуальную версию установленного на физическом или виртуальном сервере Docker можно при помощи команды

$ docker-machine ls

NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
builder.avmaksimov.ru - generic Running tcp://81.23.10.76:2376 v1.12.3
default - virtualbox Running tcp://192.168.99.100:2376 v1.12.1
manager-1.avmaksimov.ru - generic Running tcp://185.12.28.58:2376 v1.12.3
manager-2.avmaksimov.ru - generic Running tcp://185.12.28.7:2376 v1.12.3
manager-3.avmaksimov.ru - generic Running tcp://185.12.28.39:2376 v1.12.3
node-1.avmaksimov.ru - generic Running tcp://81.23.10.217:2376 v1.12.3
node-2.avmaksimov.ru - generic Running tcp://185.12.28.80:2376 v1.12.3
node-3.avmaksimov.ru - generic Running tcp://185.12.29.107:2376 v1.12.3
vpn.avmaksimov.ru * digitalocean Running tcp://45.55.235.195:2376 v1.12.4

Как видно из вывода команды самая новая версия Docker установлена на моей виртуальной машине, находящейся в Облаке DigitalOcean (v1.12.4). В K2 Cloud у меня развернут Swarm кластер на версии Docker v1.12.3. И самая старая версия Docker установлена на моем ноутбуке в VirtualBox-е (v1.12.1). Именно ее мы сейчас и обновим.

Важно! Помните о том, что при обновлении Docker происходит перезагрузка сервиса Docker управляющего всеми запущенными на вашем хосте контейнерами. При этом все контейнеры на обновляемом хосте будут остановлены и перезапущены автоматически только в том случае, если у них настроена политика автоматической перезагрузки. Проверить политику автоматической перезагрузки можно при помощи команды

$ docker inspect -f {{ .HostConfig.RestartPolicy.Name }} 'ID вашего контейнера';

Установить политику перезагрузки контейнера можно при помощи команды

$ docker update --restart=always 'ID вашего контейнера';

Опция —restart может принимать следующие значения:

  • no — перезапуск контейнера производиться не будет
  • on-failure[:max-retries] — перезапуск контейнера будет происходить max-retries раз в случае любого сбоя
  • always — перезапуск контейнера будет происходить всегда
  • unless-stopped — перезапуск контейнера будет происходить всегда до тех пор, пока вы явно не остановите контейнер

Процедура обновления сервера с Docker достаточно простая и выполняется всего одной командой

$ docker-machine upgrade default

Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Stopping machine to do the upgrade...
Upgrading machine "default"...
Default Boot2Docker ISO is out-of-date, downloading the latest release...
Latest release for github.com/boot2docker/boot2docker is v1.12.4
Downloading /Users/amaksimov/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.12.4/boot2docker.iso.
0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Copying /Users/amaksimov/.docker/machine/cache/boot2docker.iso to /Users/amaksimov/.docker/machine/machines/default/boot2docker.iso...
Starting machine back up...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Restarting docker...

https://www.systanddeploy.com/2020/06/auto-update-docker-desktop-for-windows.html



In this post I will show you a way to auto update Docker Desktop for Windows on devices using a Windows service even if user do not have admin rights.

Context
— I have to deploy Docker Desktop for Windows on devices
— Users don’t have admin rights
— When a new version od Docker is available, it allows you to update it
— Updating Docker Desktop requires admin rights


The script
Click on the below GitHub link to get the scripts:





The solution
In order to update Docker Desktop for user without to give them admin rights I created a Windows Service.
This service is executed in SYSTEM context on the user session.
The script will check for newer version and install it if true.


Special thanks to Manel and Jérôme for testing the solution.


What does the script ?
The script proceeds as below:
1. Get the installed version of Docker Deskop
2. Go to the Docker Desktop release page, here
3. Check latest version build
4. Compare the latest version available with this one installed
5. If latest version is greater, a GUI will be displayed



6. If you click on Run the update
7. Download the EXE
6. Install the newer version from EXE


Note: During the process, some toast notifications are displayed to inform of the download and install status


What does the service ?
The Windows Service proceeds as below:
1. Run the auto update script every 5 hours
2. You can change this easily


The log
Every actions from the service is logged.
You can find the log file in C:\Windows\Debug.
The log file is called Docker_update.log
See below an overview when no version has been found:
See below an overview when a new version has been found:

The update GUI
As mentioned previously, a GII is displayed to warn user a new versionis available and he should kill docker.
You can customize it as below:
1. Go to the folder Update_Warning
2. Open the file Warning_Config.xml
3. Change text as you want from the XML


How to create the service ?
Tun the script: Create_Docker_Auto_Update.ps1
This one allows you to:
1. Copy auto update content in ProgramData
2. Create the service.
3. Download the folder
4. Run this script in admin mode
5. The service will be created 


Update process in action
Before the update, I had the version 2.2.0.5 installed.

See below the update process:

Accueil
item

Docker Enterprise (Windows Server) is available at no additional cost to all Windows Server 2019 and 2016 customers. Technical support is aligned to the Microsoft support entitlement and provided by Microsoft. For more details refer the document.

How to install Docker Enterprise on Windows Server 2016 and 2019 ?

Open the powershell and execute the following commands.

Install-Module DockerMsftProvider -Force
Install-Package Docker -ProviderName DockerMsftProvider -Force

How to Test the Installation ?

Open the powershell and execute the following command.

docker container run hello-world:nanoserver

The above command will pull a hello-world image from the dockerhub registry and it will run it as a container in the docker instance. This activity requires internet connection.

How to check the Docker Version ?

Open the powershell and execute the following command. This will show the complete details of the docker installed on that machine.

docker version

How to upgrade the Docker Enterprise on Windows Server ?

First we can check whether there is any update available for the docker by executing the following command.

Find-Package -Name Docker -ProviderName DockerMSFTProvider

If any update is available, perform the update operation by executing the below command.

Install-Package -Name Docker -ProviderName DockerMSFTProvider -Update -Force

Restart the docker engine once the update is complete. The command to restart docker on windows from the command line is given below.

Restart-service docker

Solution 1:[1]

According to the Docker compose releases the latest version is 1.22.0 which is the one you have installed.

You have installed the latest docker compose, it was released 8 days ago.

Update:

In order to change your Docker compose file version just replace the line version, by today 26th July 2018 to set the latest docker compose file version just replace it by:

version: '3.7'

Solution 2:[2]

Today, 26th July 2018, docker-compose latest version is 1.22.
I don’t know why do you say that your docker-compose version is not up to date.
Maybe you had a confusion with docker-compose file version

https://github.com/docker/compose/releases

Solution 3:[3]

Solution 4:[4]

I was experiencing the same issue even though my docker-compose —version showed that the version of compose I had was 1.25.4. This didn’t work, I had tried reinstalling compose and docker desktop entirely on windows 10.

Eventually I changed my installation to use Linux containers, and used experimental mode. Worked.

Good luck.

Solution 5:[5]

You can simply go to the settings of docker desktop for Windows and select the option «Use Docker Compose V2»
Docker Desktop for windows settings

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как сделать одно окно поверх других windows 10
  • Windows 7 ultimate x86 activator
  • Shift option command r на клавиатуре windows
  • Утилита для чистки реестра windows 10
  • Добавление папки в исключения антивируса windows 10