docker镜像本地中转上传到服务器

由于服务器网络原因,不能真的下载docker镜像,通过把docker镜像下载到本地,再传到服务器
以nginx为例:

镜像拉到本地

1
docker pull nginx

镜像保存为tar文件

1
docker save -o nginx.tar nginx:latest

上传服务器

1
rz #nginx.tar文件到服务器

加载tar文件

1
docker load -i nginx.tar

运行镜像

1
docker run -it -d -p 80:80 nginx:latest --restart always

wsl2和Proxifier兼容问题

使用过Proxifier后,发现wsl2出问题了,打开子系统时提示参考的对象类型不支持尝试的操作。,搜了下网上的解决方法是通过下载NoLsp.exe解决

问题链接:https://github.com/microsoft/WSL/issues/4177#issuecomment-597736482,提供的用不了

这个里的可以用,https://github.com/dyingsu/nolsp

下载之后,管理员打开cmd执行命令

1
NoLsp.exe C:\windows\system32\wsl.exe

方法二

管理员身份在CMD执行

1
netsh winsock reset

centos安装docker

官网步骤

删除旧的

1
2
3
4
5
6
7
8
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

设置源

1
2
3
4
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

安装

启用Nightly版

1
sudo yum-config-manager --enable docker-ce-nightly

安装

1
sudo yum install docker-ce docker-ce-cli containerd.io

搜索可用版本

1
yum list docker-ce --showduplicates | sort -r

指定版本

1
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

启动

1
sudo systemctl start docker

验证

1
sudo docker run hello-world