Migrating from Docker to Docker
- Obtain the Docker collection package, including the system-level dependency package and Docker installation package.
- Decompress the Docker collection package and go to the decompressed directory.
1 2
tar -xzf docker.tar.gz cd docker
- Install system-level dependencies for your OS.
- Kylin OS
1tar -xzf Kylin-Server-V10-SP3-2403-Release-20240426-arm64.tar.gz;rpm -ivh ./Kylin-Server-V10-SP3-2403-Release-20240426-arm64/container-selinux-2.138.0-1.p01.ky10.noarch.rpm;rpm -ivh ./Kylin-Server-V10-SP3-2403-Release-20240426-arm64/libcgroup-0.42.2-4.ky10.aarch64.rpm
- UOS V20 1060e
1tar -xzf uos-server-20-1060e-20240820-arm64.tar.gz;rpm -ivh ./uos-server-20-1060e-20240820-arm64/container-selinux-2.138.0-1.uel20.noarch.rpm;rpm -ivh ./uos-server-20-1060e-20240820-arm64/libcgroup-0.42.2-3.uel20.aarch64.rpm
- Kylin OS
- Install Docker.
1 2
tar -xzf Docker-26.1.3-rpm.tar.gz; rpm -ivh ./Docker-26.1.3-rpm/*.rpm
- Verify that Docker is installed.
1docker --versionIf the following information is displayed, the installation is successful:
- Migration the Docker configuration files.
- Check whether the configuration files exist on the source server.
1 2 3
find "${HOME}"/.docker/ -name "config.json"; find /etc/docker/ -name "daemon.json"; find /etc/systemd/system/docker.service.d/ -name "http-proxy.conf"
- Collect the configuration files based on the command output in the previous step.
- Create a temporary directory for storing the configuration files.
1mkdir -p "${HOME}"/DockerConf
- If the configuration files exist, run the following commands:
1 2 3
tar -Pczvf "${HOME}"/DockerConf/config.json.tar.gz "${HOME}"/.docker/config.json; tar -Pczvf "${HOME}"/DockerConf/daemon.json.tar.gz /etc/docker/daemon.json; tar -Pczvf "${HOME}"/DockerConf/http-proxy.conf.tar.gz /etc/systemd/system/docker.service.d/http-proxy.conf
- Compress the Docker configuration files.
1cd "${HOME}" && tar -czvf DockerConf.tar.gz DockerConf && rm -rf ./DockerConf
- Create a temporary directory for storing the configuration files.
- On the target server, create a directory for storing the configuration files.
1mkdir -p "${HOME}"/.docker/ /etc/docker/
- Decompress the configuration files.
1 2 3
tar -tzf "${HOME}"/DockerConf.tar.gz | grep -q 'config.json.tar.gz' && tar -xzf "${HOME}"/DockerConf.tar.gz DockerConf/config.json.tar.gz --to-command='tar -Pxzvf - --no-same-owner'; tar -tzf "${HOME}"/DockerConf.tar.gz | grep -q 'daemon.json.tar.gz' && tar -xzf "${HOME}"/DockerConf.tar.gz DockerConf/daemon.json.tar.gz --to-command='tar -Pxzvf - --no-same-owner'; tar -tzf "${HOME}"/DockerConf.tar.gz | grep -q 'http-proxy.conf.tar.gz' && tar -xzf "${HOME}"/DockerConf.tar.gz DockerConf/http-proxy.conf.tar.gz --to-command='tar -Pxzvf - --no-same-owner'
- Reclaim resources.
1rm -rf "${HOME}"/DockerConf.tar.gz
- Check whether the configuration files exist on the source server.
- Restart the Docker service.
1sudo systemctl restart docker.service
Parent topic: Middleware Migration Guide