Mac运行Docker报错

这篇具有很好参考价值的文章主要介绍了Mac运行Docker报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Mac运行Docker报错

📔 千寻简笔记介绍

千寻简笔记已开源,Gitee与GitHub搜索chihiro-notes,包含笔记源文件.md,以及PDF版本方便阅读,且是用了精美主题,阅读体验更佳,如果文章对你有帮助请帮我点一个Star

更新:支持在线阅读文章,根据发布日期分类。

简介

本文关键词

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.Job for docker.service failed because the control process exited with error codesystemctl status docker.service" and "journalctl -xeu docker.service

实现步骤

1. 启动docker报错

root@primary:/service/java/docker# systemctl start docker.service
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
1.1 systemctl status docker.service查看docker服务的状态
  • 使用docker时,遇到 docker.service的作业失败,因为控制进程已退出,并返回错误代码。
  • 有关详细信息,请参阅“systemctl status docker.service”和“journalctl -xe”时,不一定要重装 docker。
systemctl status docker.service
# 报错信息
× docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-05-30 23:04:30 CST; 5min ago
TriggeredBy: × docker.socket
       Docs: https://docs.docker.com
    Process: 925 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status>
   Main PID: 925 (code=exited, status=1/FAILURE)
        CPU: 60ms

May 30 23:04:27 primary systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
May 30 23:04:27 primary systemd[1]: docker.service: Failed with result 'exit-code'.
May 30 23:04:27 primary systemd[1]: Failed to start Docker Application Container Engine.
May 30 23:04:30 primary systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
May 30 23:04:30 primary systemd[1]: Stopped Docker Application Container Engine.
May 30 23:04:30 primary systemd[1]: docker.service: Start request repeated too quickly.
May 30 23:04:30 primary systemd[1]: docker.service: Failed with result 'exit-code'.
May 30 23:04:30 primary systemd[1]: Failed to start Docker Application Container Engine.

Mac运行Docker报错,Java,1024程序员节

1.2 journalctl -xe 查看报错信息
root@primary:/etc/docker# journalctl -xe
Journal file /var/log/journal/8c1bf4cc93844889a4cf1a8b67be1748/user-1000@0005fa7b9a7766ed-645e5933b08e3d15.journal~ is truncated, ignoring file.
May 30 23:24:03 primary rsyslogd[594]: action 'action-3-builtin:omfile' (module 'builtin:omfile') message lost, could not be processed. Check for additional error messages before>

分析错误: No space left on devic> 设备上没有剩余空间,在错误日志中我们发现是docker安装目录满了。

解决方案:

  1. 查看目录下剩余空间
df -hl /var/lib/docker
# 显示的信息:使用已经百分百
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       4.7G  4.7G     0 100% /
  1. 查看分区容量
df -h
# 显示的信息
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            97M   11M   86M  12% /run
/dev/sda1       4.7G  4.7G     0 100% /
tmpfs           482M     0  482M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda15       98M  6.3M   92M   7% /boot/efi
tmpfs            97M  4.0K   97M   1% /run/user/1000
  1. 知道是磁盘不足,由于我们现在docker启动不了,星辰推荐先扩容,后面在对容器和镜像进行优化。

我是在Mac虚拟机(multipass)上运行的docker,默认磁盘5G,所以我们调整一下磁盘大小就可以,下面有我找到的一个博主的参考。文章来源地址https://www.toymoban.com/news/detail-720683.html

# 打开终端
xingchen@star-2 ~ % multipass ls
Name                    State             IPv4             Image
primary                 Stopped           --               Ubuntu 22.04 LTS

# 扩容命令,等号左右不能有空格
# 要修改其中一个属性,请先停止实例,然后发出命令set。例如:
multipass set local.primary.disk=10G

xingchen@star-2 ~ % multipass set local.primary.disk=10G
xingchen@star-2 ~ % 
# 可以使用命令查询这些属性get。不必为此停止实例。例如:
multipass get local.primary.disk


# 扩容完毕我们启动虚拟机在查看容量
df -h
root@primary:/home/ubuntu# df -h
# 显示的信息
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            97M   11M   86M  12% /run
/dev/sda1       4.7G  4.7G     0 100% /
tmpfs           482M     0  482M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda15       98M  6.3M   92M   7% /boot/efi
tmpfs            97M  4.0K   97M   1% /run/user/1000

# 发现一个问题,multipass 扩容以后系统磁盘不变
# 扩展完磁盘后使用lsblk查看的结果变了而使用df -h结果大小却没变,这是因为前者查看的是磁盘的大小而后者查看的是文件系统的大小。磁盘和文件系统在不严格区分时可视为同一个东西,但追究起来确实是两样东西。
root@primary:/home/ubuntu# fdisk -l
Disk /dev/loop0: 43.18 MiB, 45277184 bytes, 88432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 59.12 MiB, 61988864 bytes, 121072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 868 KiB, 888832 bytes, 1736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 43.19 MiB, 45289472 bytes, 88456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 59.09 MiB, 61960192 bytes, 121016 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 109.61 MiB, 114929664 bytes, 224472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/vda: 52 KiB, 53248 bytes, 104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
GPT PMBR size mismatch (10485759 != 20971519) will be corrected by write.
The backup GPT table is not on the end of the device.


Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
Disk model: QEMU HARDDISK   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 377B9709-DEFE-4067-8E1D-220FD9F66D56

Device      Start      End  Sectors  Size Type
/dev/sda1  206848 10485726 10278879  4.9G Linux filesystem
/dev/sda15   2048   204800   202753   99M EFI System

Partition table entries are not in disk order.
root@primary:/home/ubuntu# 


# 关于“linux磁盘扩容成功文件系统大小却没变化”问题详细解决方案
https://blog.csdn.net/qq_41999034/article/details/111030811

到了这里,关于Mac运行Docker报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 1024程序员节带你玩转图片Exif信息获取之JavaScript

    目录 一、前言 二、背景 三、Exif.js          1、Exif.js 简介 2、Exif.js 引入 四、多场景展示数据获取 1、原始图片直接获取  2、base64 编码文件加载  3、文件上传的方式加载  五、总结        1024是2的十次方,二进制计数的基本计量单位之一。1G=1024M,而1G与1级谐音,也有一

    2024年02月20日
    浏览(38)
  • 1024程序员节特辑 | Spring Boot实战 之 MongoDB分片或复制集操作

    Spring实战系列文章: Spring实战 | Spring AOP核心秘笈之葵花宝典 Spring实战 | Spring IOC不能说的秘密? 国庆中秋特辑系列文章: 国庆中秋特辑(八)Spring Boot项目如何使用JPA 国庆中秋特辑(七)Java软件工程师常见20道编程面试题 国庆中秋特辑(六)大学生常见30道宝藏编程面试题

    2024年02月08日
    浏览(59)
  • 1024程序员节特辑 | ELK+ 用户画像构建个性化推荐引擎,智能实现“千人千面”

    专栏集锦,大佬们可以收藏以备不时之需 Spring Cloud实战专栏:https://blog.csdn.net/superdangbo/category_9270827.html Python 实战专栏:https://blog.csdn.net/superdangbo/category_9271194.html Logback 详解专栏:https://blog.csdn.net/superdangbo/category_9271502.html tensorflow专栏:https://blog.csdn.net/superdangbo/category_869

    2024年02月07日
    浏览(60)
  • 1024程序员狂欢节 | IT前沿技术、人工智能、数据挖掘、网络空间安全技术

    一年一度的1024程序员狂欢节又到啦!成为更卓越的自己,坚持阅读和学习,别给自己留遗憾,行动起来吧! 那么,都有哪些好书值得入手呢?小编为大家整理了前沿技术、人工智能、集成电路科学与芯片技术、新一代信息与通信技术、网络空间安全技术,四大热点领域近期

    2024年02月06日
    浏览(55)
  • JVM运行时数据区的必备知识:Java程序员不容错过

    JVM运行时数据区是Java虚拟机在执行Java程序时所使用的内存区域。这些区域包括了以下几个部分: 程序计数器(Program Counter Register):程序计数器是一块较小的内存区域,它可以看作是当前线程所执行的字节码的行号指示器。每一个线程都有自己独立的程序计数器,用于记录

    2023年04月15日
    浏览(35)
  • 1024程序员节?我们整点AI绘图玩玩吧,一文教你配置stable-diffusion

    需提前准备:一台高性能的电脑(尤其是显存)、python、Git、梯子。 其实Github上有很多关于Stable diffusion的库,综合对比之后,我选取的是比较全面的AUTOMATIC1111这个,源码链接:Stable-diffusion(Github) 找到安装那块的教程,此教程以windows为例。 ps:如果你电脑上已经有了pyt

    2024年01月16日
    浏览(57)
  • 1024程序员节特辑 | 解密Spring Cloud Hystrix熔断提高系统的可用性和容错能力

    专栏集锦,大佬们可以收藏以备不时之需 Spring Cloud实战专栏:https://blog.csdn.net/superdangbo/category_9270827.html Python 实战专栏:https://blog.csdn.net/superdangbo/category_9271194.html Logback 详解专栏:https://blog.csdn.net/superdangbo/category_9271502.html tensorflow专栏:https://blog.csdn.net/superdangbo/category_869

    2024年02月08日
    浏览(40)
  • PHP框架开发实践 | 1024 程序员节:通过index.php找到对应的controller是如何实现的

    🏆作者简介,黑夜开发者,CSDN领军人物,全栈领域优质创作者✌,CSDN博客专家,阿里云社区专家博主,2023年6月CSDN上海赛道top4。 🏆数年电商行业从业经验,历任核心研发工程师,项目技术负责人。 🏆本文已收录于PHP专栏:PHP进阶实战教程。 🎉欢迎 👍点赞✍评论⭐收藏

    2024年02月08日
    浏览(56)
  • 1024程序员狂欢节有好礼 | 前沿技术、人工智能、集成电路科学与芯片技术、新一代信息与通信技术、网络空间安全技术

    🌹欢迎来到 爱书不爱输的程序猿 的博客, 本博客致力于知识分享,与更多的人进行学习交流 🚩🚩🚩 点击直达福利 一年一度的1024程序员狂欢节又到啦!成为更卓越的自己,坚持阅读和学习,别给自己留遗憾,行动起来吧! 那么,都有哪些好书值得入手呢?小编为大家整理

    2024年02月08日
    浏览(70)
  • 程序员笔记本电脑选 windows 还是 MAC

    计算机选择是每个进入 IT 行业同学的第一个重要选择,那么你是怎么选择的呢? 选择操作系统(Windows还是macOS)取决于程序员的需求、偏好和工作流程。每个操作系统都有其优点和缺点,下面将分别讨论它们,以帮助你做出决策。 Windows: **广泛的软件支持:**Windows是最常见

    2024年02月05日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包