docker 使用 sytemctl
目录
警告
本文最后更新于 2022-11-25,文中内容可能已过时。
允许一个 Docker container
获取主机的 systemctl
权限。
使用 Docker run
|
|
使用 Docker-compose
|
|
这里需要注意:
-
配置
privileged: true
-
在
command
需要先初始化,然后再执行其他的命令1 2 3 4 5 6 7 8
privileged: true command: - /bin/bash - -c - | cat /mnt/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys git clone git@192.168.1.171:lfang/jobs.git ~/git/jobs /usr/sbin/init
相关内容
- Docker 使用 systemctl
- docker compose command 保持容器处于活跃状态alive
- docker compose 保持 git pull 最新代码
- Ubuntu 更新 docker compose 2.1.1
- Dockerfile 使用 ssh 下载私有 git 项目

