记录一次在openwrt中折腾docker

记录一次在openwrt中折腾docker

前提

我在n1中安装了openwrt,下面是一些简单的关于这个系统的信息

image-20210314150407499

安装screen

pull镜像的时候,有可能需要比较长的等待时间。

所以,这里推荐使用screen这个应用。将我们的应用放在后台运行。

安装的命令是 opkg install screen

root@bang-bang-tang:~# opkg install luci-i18n-base-zh-cn

Unknown package 'luci-i18n-base-zh-cn'.

Collected errors:

* opkg_install_cmd: Cannot install package luci-i18n-base-zh-cn.

作者:小灰辉先生
链接:https://www.jianshu.com/p/da01ce070688
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

出现了类似上面这样的报错,先更新一下opkg update

换源

在进行docker pull 拉取镜像时,出现下面的错误:

net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

修改配置文件

vim /etc/docker/daemon.json

在文件中写入:

{
	"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
}

重启docker服务

openwrt中没有象systemctl,service这样的命令,需要使用这样的命令重启docker服务

/etc/init.d/dockerd restart

成果

成功拉取了ubuntu:18.04的镜像

image-20210314150510532

原文地址:https://www.cnblogs.com/Blithe-Chiang/p/14532578.html