docker零散命令日志记录备用

服务器运维 / 85人浏览 / 0人评论

docker 进入容器命令行bash,docker查看容器IP地址,docker inspect 容器名称或 id,查看本机容器,docker stop 容器ID,查看php扩展安装目录,设置composer镜像为国内镜像,docker rm ID删除容器

linux
docker 进入容器命令行bash
docker run -it (IMAGE ID) /bin/bash

docker run -it hyperf/hyperf:latest /bin/bash

docker查看容器IP地址

docker inspect 容器名称或 id

命令:docker inspect 容器名称或 id

mysql

docker run -itd --name mysql-users -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql

mysql -h 127.0.0.1 -u root -p

查看本机容器

docker ps (-a 全部)

docker ps -n 5

docker stop 容器ID

docker restart 容器ID

查看php扩展安装目录

php -i | grep extension_dir

查看php swoole

php --ri swoole

composer查看当前镜像

composer config -gl

设置composer镜像为国内镜像

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer

查看php指定版本安装目录

find / -name php7

sentos7 重启docker

systemctl restart docker

docker exec -it redis6 /bin/bash

docker run -d -p 6379:6379 redis /bin/bash

cd hyperf-skeleton

php bin/hyperf.php start

php bin/hyperf.php describe:routes

docker run --name hyperfone-hyperf -v /H/ProgramData/test:/hyperf-skeleton -p 9501:9501 -d hyperf/hyperf:latest php /hyperf-skeleton/bin/hyperf.php start

docker run -it --name hyperfone-hyperf -v /H/ProgramData/www:/hyperf-skeleton -p 9501:9501 hyperf/hyperf:latest

docker run -it --name hyperfone-hyperf -v /H/hyperf-rpc-master/provider_user:/hyperf-skeleton -p 9501:9501 hyperf/hyperf:latest
docker run -it --name hyperfmysql-hyperf -v /H/hyperf-rpc-master/consumer_user:/hyperf-skeleton -p 9501:9501 hyperf/hyperf:2.2.1
docker run -it --name hyperfmsyql-hyperf -v /H/hyperf-rpc-master/provider_user:/hyperf-skeleton -p 9509:9509 hyperf/hyperf:7.4

停止容器
docker stop 218245ea81a8

删除容器

docker rm 218245ea81a8

转载注明:

扩展查找

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我