docker 使用笔记

buidctl

https://depot.dev/blog/buildkit-in-depth#buildkit-under-the-hood

buildctl 示例

https://crazymax.dev/buildkit/usage/output/

https://itnext.io/buildkit-local-build-caching-and-image-scanning-450040d9ebb0

https://docs.docker.com/build/buildkit/configure/

删除registry中的镜像

https://stackoverflow.com/questions/43730680/way-to-delete-the-images-from-private-docker-registry

registry

https://distribution.github.io/distribution/

Docker Hub is Docker’s official cloud-based registry for Docker images.

https://jfrog.com/devops-tools/article/docker-hub-and-docker-registries-a-beginners-guide/

创建 registry

https://dev.to/docker/creating-a-private-local-docker-registry-in-5-minutes-2dnl

https://www.linkedin.com/pulse/creating-private-secure-docker-registry-pankaj-deswal-fhtjf

https://www.docker.com/blog/how-to-use-your-own-registry-2/

https://hosting.analythium.io/we-need-to-talk-about-docker-registries/

image registry repository tag 的区别

https://stackoverflow.com/questions/31115098/what-is-the-difference-between-an-image-and-a-repository

https://stackoverflow.com/questions/34004076/difference-between-docker-registry-and-repository

save 和 export 的区别

https://tuhrig.de/flatten-a-docker-container-or-image/

https://stackoverflow.com/questions/36925261/what-is-the-difference-between-import-and-load-in-docker

https://www.baeldung.com/ops/docker-save-export

https://pspdfkit.com/blog/2019/docker-import-export-vs-load-save/

镜像瘦身

https://stackoverflow.com/questions/22713551/how-to-flatten-a-docker-image

默认使用http
https://stackoverflow.com/questions/42211380/add-insecure-registry-to-docker
https://stackoverflow.com/questions/49674004/docker-repository-server-gave-http-response-to-https-client
https://github.com/GoogleContainerTools/kaniko/tree/release/v1.10.0?tab=readme-ov-file#flag—insecure
https://github.com/containers/image/blob/release-5.30/docs/containers-registries.conf.5.md#example-1
https://docs.docker.com/build/buildkit/toml-configuration/

https://github.com/moby/buildkit/issues/2096

https://github.com/moby/buildkit/blob/v0.13.0/util/resolver/resolver.go

### 如何在Docker容器中访问和使用笔记本电脑内置摄像头 为了使Docker容器能够访问主机上的硬件设备,比如笔记本电脑的内置摄像头,通常需要确保几个方面配置正确。这不仅涉及到了解如何启动具有适当权限的容器,还涉及到宿主机上必要的驱动程序和支持。 #### 启动带有USB支持的Docker容器 为了让Docker容器可以访问外部设备如摄像头,在创建或运行容器时需指定`--privileged=true`选项来赋予更高的权限[^3]。然而更推荐的做法是指定具体的设备而不是给予整个特权模式: ```bash docker run -it --device=/dev/video0:/dev/video0 ubuntu bash ``` 这条命令中的`/dev/video0`代表的是Linux系统下第一个检测到的视频捕捉设备(即摄像头)。如果不确定具体路径可以在宿主机执行`v4l2-ctl --list-devices`查看所有可用视频设备及其对应的节点名称。 对于某些情况可能还需要安装额外软件包以便于操作这些多媒体资源,例如FFmpeg用于处理音视频流数据或是VLC player作为播放工具等。 #### 配置Docker守护进程以允许USB设备传递 有时即使指定了特定设备文件也未必能成功获取图像帧序列,这时就需要进一步调整Docker Daemon配置使其接受来自USB接口的数据传输请求。编辑位于/etc/docker/daemon.json内的JSON对象加入如下字段: ```json { "default-ulimits": { "nofile": {"Name":"nofile","Hard":65535,"Soft":65535} }, "features": {"apparmor":false}, "insecure-registries":["localhost:5000"] } ``` 请注意上述设置可能会降低安全性因此仅建议开发测试环境中应用;生产环境应谨慎评估风险后再做决定。 另外值得注意的一点是在Windows或者macOS平台上由于架构差异实现方式会有所不同,这里主要讨论基于Linux系统的方案。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值