使用 docker inspect 和 jq 命令快速查看容器挂载目录、docker-compose.yaml 路径 作者: Chuwen 时间: 2024-07-31 分类: 神奇技巧 评论 关于 `jq` 命令的详细解释及安装教程:https://wangchujiang.com/linux-command/c/jq.html --- 语法: ```shell docker inspect | jq '.[0].Mounts' ``` 例如: ```shell shine@Shine-Win11:~/documents/self-projects/tmp$ docker inspect aa3f359ddc0e | jq '.[0].Mounts' [ { "Type": "bind", "Source": "/home/shine/documents/git/projects/docker-elk/elasticsearch/config/elasticsearch.yml", "Destination": "/usr/share/elasticsearch/config/elasticsearch.yml", "Mode": "ro,Z", "RW": false, "Propagation": "rprivate" }, { "Type": "volume", "Name": "docker-elk_elasticsearch", "Source": "/var/lib/docker/volumes/docker-elk_elasticsearch/_data", "Destination": "/usr/share/elasticsearch/data", "Driver": "local", "Mode": "z", "RW": true, "Propagation": "" } ] ``` ![](https://cdn.nowtime.cc/2024/07/31/3809813538.png) ## 查看 docker-compose.yaml 路径 语法: ```shell docker inspect | jq '.[0].Config.Labels' ``` 示例: ```shell shine@Shine-Win11:~/documents/git/projects/docker-elk$ docker inspect 8334b593b89a | jq '.[0].Config.Labels' { "com.docker.compose.config-hash": "d1f80fc712ff55f9f33eafc4842bf71f947a6584b27eb548bca0c0dc399bff8b", "com.docker.compose.container-number": "1", "com.docker.compose.depends_on": "", "com.docker.compose.image": "sha256:de7d209b219972d54381f0a7d18671d0c3aa1f3b4410a607cb82d34a08a97dc8", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "frankenphp-typecho", "com.docker.compose.project.config_files": "/mnt/c/Users/Shine/Documents/Self/projects/frankenphp-typecho/docker-compose.yaml", "com.docker.compose.project.working_dir": "/mnt/c/Users/Shine/Documents/Self/projects/frankenphp-typecho", "com.docker.compose.replace": "3a7bd46c1737dd0ce32be2e6f4b246ca3e2778bbc83d105579c994e8fadc3a17", "com.docker.compose.service": "wordpress", "com.docker.compose.version": "2.24.7", "org.opencontainers.image.created": "2024-04-23T12:51:06Z", "org.opencontainers.image.description": "The modern PHP app server", "org.opencontainers.image.licenses": "MIT", "org.opencontainers.image.revision": "a9ebc3aeea590b45422a19510473955b372d09aa", "org.opencontainers.image.source": "https://github.com/dunglas/frankenphp", "org.opencontainers.image.title": "FrankenPHP", "org.opencontainers.image.url": "https://frankenphp.dev", "org.opencontainers.image.vendor": "Kévin Dunglas", "org.opencontainers.image.version": "v1.1.3" } ``` ![](https://cdn.nowtime.cc/2024/07/31/1733369616.png)
Windows Navicat Premium 16 直链下载(非 www.navicat.com.cn 网站) 作者: Chuwen 时间: 2024-07-30 分类: 软件 评论 ## Navicat Premium 16 官方(www.navicat.com)下载地址 * [Navicat Premium 16(简体中文)](https://www.navicat.com/download/direct-download?product=navicat160_premium_cs_x64.exe&location=1 "Navicat Premium(简体中文)") * [Navicat Premium 16(English)](https://www.navicat.com/download/direct-download?product=navicat160_premium_en_x64.exe&location=1 "Navicat Premium(简体中文)") ## Navicat Premium 17 官方(www.navicat.com)下载地址 * [Navicat Premium 17(简体中文)](https://www.navicat.com/download/direct-download?product=navicat170_premium_cs_x64.exe&location=1 "Navicat Premium(简体中文)") * [Navicat Premium 17(English)](https://www.navicat.com/download/direct-download?product=navicat170_premium_en_x64.exe&location=1 "Navicat Premium(简体中文)")
composer 永久忽略安装包时提示依赖 xx 扩展 作者: Chuwen 时间: 2024-07-02 分类: PHP 评论 ## 问题 在本地开发时,如果使用 composer 安装 composer 包经常会遇到这种提示: ``` Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires php ^8.3 but your php version (8.2.9) does not satisfy that requirement. Problem 2 - Root composer.json requires PHP extension ext-posix * but it is missing from your system. Install or enable PHP's posix extension. Problem 3 - Root composer.json requires PHP extension ext-rdkafka * but it is missing from your system. Install or enable PHP's rdkafka extension. Problem 4 - hhxsv5/laravel-s is locked to version v3.8.0 and an update of this package was not requested. - hhxsv5/laravel-s v3.8.0 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension. Problem 5 - laravel/horizon is locked to version v5.24.4 and an update of this package was not requested. - laravel/horizon v5.24.4 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension. Problem 6 - laravel/pail is locked to version v1.1.3 and an update of this package was not requested. - laravel/pail v1.1.3 requires ext-pcntl * -> it is missing from your system. Install or enable PHP's pcntl extension. To enable extensions, verify that they are enabled in your .ini files: - C:\Users\Shine\.pvm\versions\php-8.2\php.ini You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with `--ignore-platform-req=ext-posix --ignore-platform-req=ext-rdkafka --ignore-platform-req=ext-pcntl` to temporarily ignore these required extensions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require dcat/laravel-admin:*" to figure out if any version is installable, or "composer require dcat/laravel-admin:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content. ``` ![](https://cdn.nowtime.cc/2024/07/02/2434538828.png) 实际上在本机开发过程中通常不需要用到这些依赖扩展,或者你是 Windows 作为开发环境,那么像 `posix`, `pcntl` 扩展在 Windows 上是安装不上的,所以我都会加上 `--ignore-platform-reqs` 选项,来跳过对这些扩展的检查,但是每次装 composer 包都要手打这个选项实在是太过繁琐,有没有直接替我加上这个选项的方法? ## 过程 通过查阅[Composer 官方文档](https://getcomposer.org/doc/03-cli.md#composer-ignore-platform-req-or-composer-ignore-platform-reqs "Composer 官方文档"),确实有这么一个方法,设置一个环境变量 `COMPOSER_IGNORE_PLATFORM_REQS=1` 即可解决 ## 结果 Windows 添加环境变量 1. 按下 `Win` + `R` 输入 `sysdm.cpl` 然后按 `Enter` 2. 选择“环境变量” 3. 新建环境变量 4. 输入变量名 `COMPOSER_IGNORE_PLATFORM_REQS` 5. 输入变量值 `1` 6. 确定 -> 确定 -> 确定 7. 完成 ![](https://cdn.nowtime.cc/2024/07/02/3423099981.png)