记录误删除docker中极狐gitlab容器恢复过程

如题一次误操作导致删除了docker中极狐gitlab容器恢复过程

  1. 情况说明
    创建容器时,我是用的是极狐官网推荐安装的步骤,具体按照官网步骤走就行
bash 复制代码
sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --shm-size 256m \
  registry.gitlab.cn/omnibus/gitlab-jh:latest

详见:https://docs.gitlab.cn/jh/install/docker.html

2.误删除后同样使用上述的命令启动容器会报错
docker启动报错:Error response from daemon: shim error: docker-runc not installed on system

2.1解决办法

创建软连接

bash 复制代码
[root@localhost ~]#cd /usr/libexec/docker/

[root@localhost ~]#sudo ln -s docker-runc-current docker-runc
复制代码
仍然报错,创建全局软连接
bash 复制代码
[root@localhost ~]#sudo ln -s /usr/libexec/docker/docker-runc-current /usr/bin/docker-runc

创建完后在宿主机上查看就是这个样子

其实就是docker执行命令指向当前(个人理解)。

通过这个确实解决了启动报错的问题。但是至于删除容器后为什么会产生这个问题表示疑问,我猜测可能还是权限的问题

3.启动后发现git还是访问不了,然后docker ps -a 查看发现gitlab起不来。一致重启。然后docker exec也进不去

通过 docker logs 镜像id 查看容器启动日志发现报错
Failed to create thread: Operation not permitted (我这里是截取的主要错误,日志忘截图了)

3.1解决办法
解决这个错误只需要在启动参数中添加如下参数就可以--privileged=true。

参照:

https://www.jianshu.com/p/303996dc4e2d

https://blog.csdn.net/susuruo/article/details/124733962

相关推荐
雪可问春风20 小时前
docker环境部署
运维·docker·容器
双份浓缩馥芮白21 小时前
【Docker】Linux 迁移 docker 目录(软链接)
linux·docker
kobe_OKOK_1 天前
S7 adapter Docker run
运维·docker·容器
一个欠登儿程序员1 天前
在国产服务器上通过 Docker 部署 Windows 虚拟机
服务器·windows·docker
Hadoop_Liang1 天前
构建Spring Boot项目Docker镜像
spring boot·后端·docker
Learn-Python1 天前
修改docker容器内文件后让其生效
运维·docker·容器
http阿拉丁神猫1 天前
kubernetes知识点汇总37-42
云原生·容器·kubernetes
赵丙双1 天前
docker restart 策略
docker·restart
工具罗某人1 天前
docker实现redis-cluster模式集群部署
java·redis·docker
L1624761 天前
Containerd 完整部署安装与使用指南
容器