完全删除Docker

完全删除Docker 在使用了docker一段时间后,会发现系统上各种容器乱七八糟,启动的,未启动的,正常运行的,异常的,搞得人不胜其烦。 下面是一次完全删除docker容器并删除docker本身的实例,可以完美解决以上问题。 查询并停止/删除当前运行容器 ➜ ~ docker ps -aq 80bb62721c12 # 停止当前运行容器 ➜ ~ docker stop $(docker ps -aq) 80bb62721c12 # 删除当前运行容器 ➜ ~ docker rm $(docker ps -aq) 80bb62721c12 删除所有image镜像 ➜ ~ docker rmi $(docker images -q) Untagged: traffmonetizer/cli_v2:latest Untagged: traffmonetizer/cli_v2@sha256:4fc48893746664471a1c386efabb5eba0537955fe5ecae871ed4a5e5c33ecf03 Deleted: sha256:3f82fd6f8f4f5ae49cf715a45db4abb3c0bef25be4d351ebe82e747f8641dd0b Deleted: sha256:d732b5c154d947acd46254d7c729eea712f5dd3e0518884a50cc4ada4da9706d Deleted: sha256:037fbfa145577a9bc6472afdf57979ff128102d42806eebc4dcdbc7eb0c91ff5 Deleted: sha256:e44bc785a3f33dea2990cff187bc1c2b7fea4fa9dfa24a6c3ad3e4c149e7aa80 Deleted: sha256:aa0a4b16279d7f4e301aa29ff8bb3fb2e5eaf2417e8119bd3c92f99da975d674 Deleted: sha256:54d0ead5d2a5dd2e830b333508445bc7e9cbed60b1ec4091d667c71349a9b31c Deleted: sha256:bd00ba4d604e3a30bba51756da10622d2242a8540dc03a46a07584575d736590 Deleted: sha256:d4fc045c9e3a848011de66f34b81f052d4f2c15a17bb196d637e526349601820 卸载docker ➜ ~ apt purge docker-ce Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: pigz Use 'apt autoremove' to remove it. The following packages will be REMOVED: docker-ce* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 109 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64321 files and directories currently installed.) Removing docker-ce (5:27.2.0-1~debian.12~bookworm) ... (Reading database ... 64312 files and directories currently installed.) Purging configuration files for docker-ce (5:27.2.0-1~debian.12~bookworm) ... ➜ ~ apt purge docker-ce-cli Reading package lists... Done Building dependency tree... Done Reading state information... Done The following package was automatically installed and is no longer required: pigz Use 'apt autoremove' to remove it. The following packages will be REMOVED: docker-ce-cli* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 40.9 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64310 files and directories currently installed.) Removing docker-ce-cli (5:27.2.0-1~debian.12~bookworm) ... Processing triggers for man-db (2.11.2-2) ... ➜ ~ apt purge docker-ce-rootless-extras docker-buildx-plugin Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libslirp0 pigz slirp4netns Use 'apt autoremove' to remove them. The following packages will be REMOVED: docker-buildx-plugin* docker-ce-rootless-extras* 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. After this operation, 102 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64111 files and directories currently installed.) Removing docker-buildx-plugin (0.16.2-1~debian.12~bookworm) ... Removing docker-ce-rootless-extras (5:27.2.0-1~debian.12~bookworm) ... ➜ ~ apt purge docker-compose-plugin Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libslirp0 pigz slirp4netns Use 'apt autoremove' to remove them. The following packages will be REMOVED: docker-compose-plugin* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 63.3 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 64102 files and directories currently installed.) Removing docker-compose-plugin (2.29.2-1~debian.12~bookworm) ...

八月 29, 2024 · JQX

树莓派最新版系统开启SSH登录和设置默认用户

下载系统为Raspberry Pi OS Lite,信息如下: Release date: May 3rd 2023 System: 32-bit Kernel version: 6.1 Debian version: 11 (bullseye) 下载后使用balenaEtcher写入tf卡。 进入到bootfs分区,新建ssh空文件即可开启默认ssh登录。 alair@op36 MINGW64 /f $ touch ssh 添加默认登录用户和密码 首先使用如下命令生成密码,password为自定义密码 alair@op36 MINGW64 /f $ echo 'password' | openssl passwd -6 -stdin $6$lAkAjoGFYOCieBlt$9ezLlyXlizpAP7lYNJRL.1cvdQOOkn.hsTnSQP3gtJT5EpfJvqwBo/BhdbUZ T.xMZIFyANfxf/8ckI590But20 然后还是在bootfs目录,新建userconf文件 vi userconf 写入以下内容 raspi:$6$lAkAjoGFYOCieBlt$9ezLlyXlizpAP7lYNJRL.1cvdQOOkn.hsTnSQP3gtJT5EpfJvqwBo/BhdbUZ T.xMZIFyANfxf/8ckI590But20 保存退出即可。 以上就会添加用户名为raspi密码为password的账户信息,接下来就可以使用ssh登录进行设置了。

六月 10, 2023 · JQX

使用gitolite自建git服务器

服务器环境如下: ➜ ~ neofetch `.::///+:/-. --///+//-:`` pi@raspi2b `+oooooooooooo: `+oooooooooooo: ---------- /oooo++//ooooo: ooooo+//+ooooo. OS: Raspbian GNU/Linux 11 (bullseye) armv `+ooooooo:-:oo- +o+::/ooooooo: Host: Raspberry Pi 2 Model B Rev 1.1 `:oooooooo+`` `.oooooooo+- Kernel: 6.1.21-v7+ `:++ooo/. :+ooo+/.` Uptime: 1 hour, 53 mins ...` `.----.` ``.. Packages: 624 (dpkg) .::::-``:::::::::.`-:::-` Shell: zsh 5.8 -:::-` .:::::::-` `-:::- Terminal: /dev/pts/1 `::. `.--.` `` `.---.``.::` CPU: BCM2835 (4) @ 1.000GHz .::::::::` -::::::::` ` Memory: 70MiB / 921MiB .::` .:::::::::- `::::::::::``::. -:::` ::::::::::. ::::::::::.`:::- :::: -::::::::. `-:::::::: :::: -::- .-:::-.``....``.-::-. -::- .. `` .::::::::. `..`.. -:::-` -::::::::::` .:::::` :::::::` -::::::::::` :::::::. .::::::: -::::::::. :::::::: `-:::::` ..--.` ::::::. `...` `...--..` `...` .:::::::::: `.-::::-` 添加git用户 服务器添加git用户并设置密码 ...

六月 9, 2023 · JQX

网络文件系统SSHFS使用实例

什么是SSHFS? SSHFS是一个通过SSH连接到服务器的网络文件系统客户端。 SSHFS允许您使用SFTP挂载远程文件系统。 大多数VPS SSH服务器默认情况下都支持并启用此SFTP访问,因此SSHFS使用非常简单,无需在服务器端执行任何操作。 项目当前状态 SSHFS由所有主要的Linux发行版本提供,并且已经在多种系统上投入生产使用多年。 但是,目前SSHFS没有任何活动的常规贡献者,并且存在许多已知问题(请参阅Bugtracker)。 当前的维护者继续应用拉取请求并进行定期发布,但是不幸的是,除了解决高影响力的问题之外,它没有能力进行任何开发。 报告错误时,请理解,除非您包含拉取请求或报告严重问题,否则您可能不会得到响应。 安装SSHFS 首先,从https://github.com/libfuse/sshfs/releases下载最新的SSHFS版本。 在Linux和BSD上,您还需要安装libfuse 3.1.0或更高版本。 在macOS上,您需要OSXFUSE。 最后,您需要带有开发标头的Glib库(应该可以从操作系统的程序包管理器中获得)。 构建和安装,我们建议使用Meson(0.38版或更高版本)和Ninja。 解压缩sshfs tarball之后,创建一个(临时)构建目录并运行Meson: $ mkdir build; cd build $ meson .. 通常,默认的构建选项可以正常工作。 但是,如果您要调整它们,可以使用mesonconf命令进行: $ mesonconf # list options $ mesonconf -D strip=true # set an option 构建,测试和安装SSHFS,请使用Ninja(运行测试需要py.test Python模块): $ ninja $ python3 -m pytest test/ # optional, but recommended $ sudo ninja install CentOS安装sshfs简单方法 yum install -y epel-release yum -y install fuse-sshfs 使用SSHFS 安装了sshfs后,运行它就非常简单: sshfs [user@]hostname:[directory] mountpoint 建议以普通用户(而不是root)身份运行SSHFS。 为此,mountpoint必须归用户所有。 如果省略用户名,SSHFS将使用本地用户名。 如果省略目录,SSHFS将挂载(远程)主目录。 如果您需要输入密码,sshfs会要求您输入密码(实际上,它只是运行ssh,如果需要,它会要求输入密码)。 ...

九月 26, 2020 · JQX

UbuntuTouch更换国内源

在一加3T上安装完UbuntuTouch后,参考此文开启SSH登录。 接下来就是更换软件源了,国内推荐USTC和清华大学开源镜像。 通过vi /etc/apt/sources.list 编辑软件源,然后在vi中通过以下命令进行替换操作: :%s/ports.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g 保存后即可。

八月 4, 2019 · JQX